forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.8'
Conflicts: qbs/modules/qtc/qtc.qbs qtcreator.pri src/plugins/cpptools/compileroptionsbuilder.cpp Change-Id: I87f47cecbb924064296a002fd9446a0627acad8e
This commit is contained in:
@@ -246,17 +246,13 @@ class Dumper(DumperBase):
|
||||
#warn('TARGET TYPE: %s' % targetType)
|
||||
if targetType.code == gdb.TYPE_CODE_ARRAY:
|
||||
val = self.Value(self)
|
||||
val.laddress = toInteger(nativeValue.address)
|
||||
val.nativeValue = nativeValue
|
||||
else:
|
||||
# Cast may fail (e.g for arrays, see test for Bug5799)
|
||||
val = self.fromNativeValue(nativeValue.cast(targetType))
|
||||
val.type = self.fromNativeType(nativeType)
|
||||
val.nativeValue = nativeValue
|
||||
#warn('CREATED TYPEDEF: %s' % val)
|
||||
return val
|
||||
|
||||
else:
|
||||
val = self.Value(self)
|
||||
|
||||
val.nativeValue = nativeValue
|
||||
if not nativeValue.address is None:
|
||||
val.laddress = toInteger(nativeValue.address)
|
||||
|
@@ -2275,3 +2275,10 @@ def __lldb_init_module(debugger, internal_dict):
|
||||
if not __name__ == 'qt':
|
||||
# Make available under global 'qt' name for consistency
|
||||
internal_dict['qt'] = internal_dict[__name__]
|
||||
|
||||
|
||||
if __name__ == "lldbbridge":
|
||||
try:
|
||||
theDumper = Dumper()
|
||||
except Exception as error:
|
||||
print('@\nstate="enginesetupfailed",error="{}"@\n'.format(error))
|
||||
|
@@ -28666,7 +28666,7 @@ Preselects a desktop Qt for building the application if available.</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty qmake Project</source>
|
||||
<translation>Пустрой проект qmake</translation>
|
||||
<translation>Пустой проект qmake</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Define Project Details</source>
|
||||
|
@@ -117,10 +117,13 @@ private:
|
||||
if (layoutDirection() == Qt::LeftToRight)
|
||||
rr = viewport()->width() - event->x();
|
||||
if (rr < clearButtonSize.width()) {
|
||||
const QModelIndex index = indexAt(event->pos());
|
||||
if (index.isValid()) {
|
||||
model->removeRow(indexAt(event->pos()).row());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
QListView::mousePressEvent(event);
|
||||
}
|
||||
|
||||
|
@@ -142,6 +142,9 @@ QTextCursor wordStartCursor(const QTextCursor &textCursor)
|
||||
|
||||
int utf8NthLineOffset(const QTextDocument *textDocument, const QByteArray &buffer, int line)
|
||||
{
|
||||
if (textDocument->blockCount() < line)
|
||||
return -1;
|
||||
|
||||
if (textDocument->characterCount() == buffer.size() + 1)
|
||||
return textDocument->findBlockByNumber(line - 1).position();
|
||||
|
||||
|
@@ -25,6 +25,8 @@
|
||||
|
||||
#include "clangcompletionchunkstotextconverter.h"
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
|
||||
@@ -70,6 +72,11 @@ void CompletionChunksToTextConverter::setAddSpaces(bool addSpaces)
|
||||
m_addSpaces = addSpaces;
|
||||
}
|
||||
|
||||
void CompletionChunksToTextConverter::setHonorVerticalSpace(bool honor)
|
||||
{
|
||||
m_honorVerticalSpace = honor;
|
||||
}
|
||||
|
||||
void CompletionChunksToTextConverter::setAddExtraVerticalSpaceBetweenBraces(
|
||||
bool addExtraVerticalSpaceBetweenBraces)
|
||||
{
|
||||
@@ -145,6 +152,8 @@ QString CompletionChunksToTextConverter::convertToName(
|
||||
{
|
||||
CompletionChunksToTextConverter converter;
|
||||
|
||||
converter.setHonorVerticalSpace(false);
|
||||
|
||||
converter.parseChunks(codeCompletionChunks);
|
||||
|
||||
return converter.text();
|
||||
@@ -183,6 +192,10 @@ void CompletionChunksToTextConverter::parse(
|
||||
parsePlaceHolder(codeCompletionChunk); break;
|
||||
case CodeCompletionChunk::LeftParen: parseLeftParen(codeCompletionChunk); break;
|
||||
case CodeCompletionChunk::LeftBrace: parseLeftBrace(codeCompletionChunk); break;
|
||||
case CodeCompletionChunk::VerticalSpace:
|
||||
if (!m_honorVerticalSpace)
|
||||
break;
|
||||
Q_FALLTHROUGH();
|
||||
default: parseText(codeCompletionChunk.text); break;
|
||||
}
|
||||
}
|
||||
|
@@ -50,6 +50,7 @@ public:
|
||||
void setAddPlaceHolderPositions(bool addPlaceHolderPositions);
|
||||
void setAddResultType(bool addResultType);
|
||||
void setAddSpaces(bool addSpaces);
|
||||
void setHonorVerticalSpace(bool honor);
|
||||
void setAddExtraVerticalSpaceBetweenBraces(bool addExtraVerticalSpaceBetweenBraces);
|
||||
void setEmphasizeOptional(bool emphasizeOptional); // Only for Html format
|
||||
void setAddOptional(bool addOptional);
|
||||
@@ -103,6 +104,7 @@ private:
|
||||
bool m_addPlaceHolderPositions = false;
|
||||
bool m_addResultType = false;
|
||||
bool m_addSpaces = false;
|
||||
bool m_honorVerticalSpace = true;
|
||||
bool m_addExtraVerticalSpaceBetweenBraces = false;
|
||||
bool m_emphasizeOptional = false;
|
||||
bool m_addOptional = false;
|
||||
|
@@ -242,40 +242,43 @@ static QString clangIncludeDirectory(const QString &clangVersion,
|
||||
#endif
|
||||
}
|
||||
|
||||
static int lastIncludeIndex(const QStringList &options, const QRegularExpression &includePathRegEx)
|
||||
{
|
||||
int index = options.lastIndexOf(includePathRegEx);
|
||||
|
||||
while (index > 0 && options[index - 1] != includeUserPathOption
|
||||
&& options[index - 1] != includeSystemPathOption) {
|
||||
index = options.lastIndexOf(includePathRegEx, index - 1);
|
||||
}
|
||||
|
||||
if (index == 0)
|
||||
index = -1;
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
static int includeIndexForResourceDirectory(const QStringList &options, bool isMacOs = false)
|
||||
static QStringList insertResourceDirectory(const QStringList &options,
|
||||
const QString &resourceDir,
|
||||
bool isMacOs = false)
|
||||
{
|
||||
// include/c++, include/g++, libc++\include and libc++abi\include
|
||||
static const QString cppIncludes = R"((.*[\/\\]include[\/\\].*(g\+\+|c\+\+).*))"
|
||||
R"(|(.*libc\+\+[\/\\]include))"
|
||||
R"(|(.*libc\+\+abi[\/\\]include))";
|
||||
static const QRegularExpression includeRegExp("\\A(" + cppIncludes + ")\\z");
|
||||
|
||||
QStringList optionsBeforeResourceDirectory;
|
||||
QStringList optionsAfterResourceDirectory;
|
||||
QRegularExpression includeRegExp;
|
||||
if (!isMacOs) {
|
||||
includeRegExp = QRegularExpression("\\A(" + cppIncludes + ")\\z");
|
||||
} else {
|
||||
// The same as includeRegExp but also matches /usr/local/include
|
||||
static const QRegularExpression includeRegExpMac(
|
||||
includeRegExp = QRegularExpression(
|
||||
"\\A(" + cppIncludes + R"(|([\/\\]usr[\/\\]local[\/\\]include))" + ")\\z");
|
||||
}
|
||||
|
||||
const int cppIncludeIndex = lastIncludeIndex(options,
|
||||
isMacOs ? includeRegExpMac : includeRegExp);
|
||||
for (const QString &option : options) {
|
||||
if (option == includeSystemPathOption)
|
||||
continue;
|
||||
|
||||
if (cppIncludeIndex > 0)
|
||||
return cppIncludeIndex + 1;
|
||||
if (includeRegExp.match(option).hasMatch()) {
|
||||
optionsBeforeResourceDirectory.push_back(includeSystemPathOption);
|
||||
optionsBeforeResourceDirectory.push_back(option);
|
||||
} else {
|
||||
optionsAfterResourceDirectory.push_back(includeSystemPathOption);
|
||||
optionsAfterResourceDirectory.push_back(option);
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
optionsBeforeResourceDirectory.push_back(includeSystemPathOption);
|
||||
optionsBeforeResourceDirectory.push_back(resourceDir);
|
||||
|
||||
return optionsBeforeResourceDirectory + optionsAfterResourceDirectory;
|
||||
}
|
||||
|
||||
void CompilerOptionsBuilder::insertWrappedQtHeaders()
|
||||
@@ -354,20 +357,13 @@ void CompilerOptionsBuilder::addHeaderPathOptions()
|
||||
// Exclude all built-in includes and Clang resource directory.
|
||||
m_options.prepend("-nostdinc");
|
||||
|
||||
const QString clangIncludePath = clangIncludeDirectory(m_clangVersion,
|
||||
m_clangResourceDirectory);
|
||||
const int includeIndexForResourceDir
|
||||
= includeIndexForResourceDirectory(builtInIncludes,
|
||||
const QString clangIncludePath
|
||||
= clangIncludeDirectory(m_clangVersion, m_clangResourceDirectory);
|
||||
|
||||
builtInIncludes = insertResourceDirectory(builtInIncludes,
|
||||
clangIncludePath,
|
||||
m_projectPart.toolChainTargetTriple.contains(
|
||||
"darwin"));
|
||||
|
||||
if (includeIndexForResourceDir >= 0) {
|
||||
builtInIncludes.insert(includeIndexForResourceDir, clangIncludePath);
|
||||
builtInIncludes.insert(includeIndexForResourceDir, includeSystemPathOption);
|
||||
} else {
|
||||
builtInIncludes.prepend(clangIncludePath);
|
||||
builtInIncludes.prepend(includeSystemPathOption);
|
||||
}
|
||||
}
|
||||
|
||||
m_options.append(builtInIncludes);
|
||||
|
@@ -242,7 +242,7 @@ TextEditor::TabSettings CppCodeStyleSettings::currentProjectTabSettings()
|
||||
TextEditor::ICodeStylePreferences *codeStylePreferences
|
||||
= editorConfiguration->codeStyle(CppTools::Constants::CPP_SETTINGS_ID);
|
||||
QTC_ASSERT(codeStylePreferences, return currentGlobalTabSettings());
|
||||
return codeStylePreferences->tabSettings();
|
||||
return codeStylePreferences->currentTabSettings();
|
||||
}
|
||||
|
||||
TextEditor::TabSettings CppCodeStyleSettings::currentGlobalTabSettings()
|
||||
@@ -251,7 +251,7 @@ TextEditor::TabSettings CppCodeStyleSettings::currentGlobalTabSettings()
|
||||
= CppTools::CppToolsSettings::instance()->cppCodeStyle();
|
||||
QTC_ASSERT(cppCodeStylePreferences, return TextEditor::TabSettings());
|
||||
|
||||
return cppCodeStylePreferences->tabSettings();
|
||||
return cppCodeStylePreferences->currentTabSettings();
|
||||
}
|
||||
|
||||
|
||||
|
@@ -418,6 +418,8 @@ public:
|
||||
m_watchHandler.cleanup();
|
||||
m_engine->showMessage(tr("Debugger finished."), StatusBar);
|
||||
m_engine->setState(DebuggerFinished); // Also destroys views.
|
||||
if (boolSetting(SwitchModeOnExit))
|
||||
EngineManager::deactivateDebugMode();
|
||||
}
|
||||
|
||||
void scheduleResetLocation()
|
||||
@@ -2619,7 +2621,10 @@ void CppDebuggerEngine::validateRunParameters(DebuggerRunParameters &rp)
|
||||
"experience for this binary format.").arg(preferredDebugger);
|
||||
break;
|
||||
}
|
||||
if (warnOnRelease && rp.cppEngineType == CdbEngineType) {
|
||||
if (warnOnRelease
|
||||
&& rp.cppEngineType == CdbEngineType
|
||||
&& rp.startMode != AttachToRemoteServer) {
|
||||
QTC_ASSERT(!rp.symbolFile.isEmpty(), return);
|
||||
if (!rp.symbolFile.endsWith(".exe", Qt::CaseInsensitive))
|
||||
rp.symbolFile.append(".exe");
|
||||
QString errorMessage;
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include "debuggermainwindow.h"
|
||||
#include "debuggerconstants.h"
|
||||
#include "debuggerinternalconstants.h"
|
||||
#include "enginemanager.h"
|
||||
|
||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
@@ -696,7 +697,7 @@ void Perspective::addWindow(QWidget *widget,
|
||||
|
||||
void Perspective::select()
|
||||
{
|
||||
ModeManager::activateMode(Debugger::Constants::MODE_DEBUG);
|
||||
Debugger::Internal::EngineManager::activateDebugMode();
|
||||
if (Perspective::currentPerspective() == this)
|
||||
return;
|
||||
theMainWindow->d->selectPerspective(this);
|
||||
|
@@ -706,7 +706,6 @@ public:
|
||||
void runScheduled();
|
||||
void attachCore();
|
||||
|
||||
void runControlFinished(DebuggerRunTool *runTool);
|
||||
void remoteCommand(const QStringList &options);
|
||||
|
||||
void dumpLog();
|
||||
|
@@ -422,6 +422,18 @@ void EngineManager::activateDebugMode()
|
||||
}
|
||||
}
|
||||
|
||||
void EngineManager::deactivateDebugMode()
|
||||
{
|
||||
if (ModeManager::currentModeId() == Constants::MODE_DEBUG && d->m_previousMode.isValid()) {
|
||||
// If stopping the application also makes Qt Creator active (as the
|
||||
// "previously active application"), doing the switch synchronously
|
||||
// leads to funny effects with floating dock widgets
|
||||
const Core::Id mode = d->m_previousMode;
|
||||
QTimer::singleShot(0, d, [mode]() { ModeManager::activateMode(mode); });
|
||||
d->m_previousMode = Id();
|
||||
}
|
||||
}
|
||||
|
||||
bool EngineManager::isLastOf(const QString &type)
|
||||
{
|
||||
int count = 0;
|
||||
|
@@ -49,6 +49,7 @@ public:
|
||||
static void unregisterEngine(DebuggerEngine *engine);
|
||||
static void activateEngine(DebuggerEngine *engine);
|
||||
static void activateDebugMode();
|
||||
static void deactivateDebugMode();
|
||||
static bool isLastOf(const QString &type);
|
||||
|
||||
static QList<QPointer<DebuggerEngine> > engines();
|
||||
|
@@ -2488,15 +2488,17 @@ void GdbEngine::updateBreakpoint(const Breakpoint &bp)
|
||||
QTC_ASSERT(state2 == BreakpointUpdateProceeding, qDebug() << state2);
|
||||
|
||||
DebuggerCommand cmd;
|
||||
if (!bp->isPending() && requested.threadSpec != bp->threadSpec()) {
|
||||
// The only way to change this seems to be to re-set the bp completely.
|
||||
cmd.function = "-break-delete " + bpnr;
|
||||
cmd.callback = [this, bp](const DebuggerResponse &r) { handleBreakThreadSpec(r, bp); };
|
||||
} else if (!bp->isPending() && requested.lineNumber != bp->lineNumber()) {
|
||||
// The only way to change this seems to be to re-set the bp completely.
|
||||
cmd.function = "-break-delete " + bpnr;
|
||||
cmd.callback = [this, bp](const DebuggerResponse &r) { handleBreakLineNumber(r, bp); };
|
||||
} else if (requested.command != bp->command()) {
|
||||
// FIXME: See QTCREATORBUG-21611, QTCREATORBUG-21616
|
||||
// if (!bp->isPending() && requested.threadSpec != bp->threadSpec()) {
|
||||
// // The only way to change this seems to be to re-set the bp completely.
|
||||
// cmd.function = "-break-delete " + bpnr;
|
||||
// cmd.callback = [this, bp](const DebuggerResponse &r) { handleBreakThreadSpec(r, bp); };
|
||||
// } else if (!bp->isPending() && requested.lineNumber != bp->lineNumber()) {
|
||||
// // The only way to change this seems to be to re-set the bp completely.
|
||||
// cmd.function = "-break-delete " + bpnr;
|
||||
// cmd.callback = [this, bp](const DebuggerResponse &r) { handleBreakLineNumber(r, bp); };
|
||||
// } else if
|
||||
if (requested.command != bp->command()) {
|
||||
cmd.function = "-break-commands " + bpnr;
|
||||
for (QString command : requested.command.split('\n')) {
|
||||
if (!command.isEmpty()) {
|
||||
|
@@ -191,6 +191,11 @@ void LldbEngine::abortDebuggerProcess()
|
||||
notifyEngineShutdownFinished();
|
||||
}
|
||||
|
||||
static QString adapterStartFailed()
|
||||
{
|
||||
return LldbEngine::tr("Adapter start failed.");
|
||||
}
|
||||
|
||||
void LldbEngine::setupEngine()
|
||||
{
|
||||
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
||||
@@ -211,7 +216,7 @@ void LldbEngine::setupEngine()
|
||||
notifyEngineSetupFailed();
|
||||
showMessage("ADAPTER START FAILED");
|
||||
if (!msg.isEmpty())
|
||||
ICore::showWarningWithOptions(tr("Adapter start failed."), msg);
|
||||
ICore::showWarningWithOptions(adapterStartFailed(), msg);
|
||||
return;
|
||||
}
|
||||
m_lldbProc.waitForReadyRead(1000);
|
||||
@@ -222,9 +227,8 @@ void LldbEngine::setupEngine()
|
||||
ICore::resourcePath().toLocal8Bit() + "/debugger/";
|
||||
|
||||
m_lldbProc.write("script sys.path.insert(1, '" + dumperSourcePath + "')\n");
|
||||
// This triggers reportState("enginesetupok") or "enginesetupfailed":
|
||||
m_lldbProc.write("script from lldbbridge import *\n");
|
||||
m_lldbProc.write("script print(dir())\n");
|
||||
m_lldbProc.write("script theDumper = Dumper()\n"); // This triggers reportState("enginesetupok")
|
||||
|
||||
QString commands = nativeStartupCommands();
|
||||
if (!commands.isEmpty())
|
||||
@@ -384,7 +388,7 @@ void LldbEngine::handleResponse(const QString &response)
|
||||
cmd.callback(response);
|
||||
}
|
||||
} else if (name == "state")
|
||||
handleStateNotification(item);
|
||||
handleStateNotification(all);
|
||||
else if (name == "location")
|
||||
handleLocationNotification(item);
|
||||
else if (name == "output")
|
||||
@@ -830,9 +834,9 @@ void LldbEngine::readLldbStandardOutput()
|
||||
}
|
||||
}
|
||||
|
||||
void LldbEngine::handleStateNotification(const GdbMi &reportedState)
|
||||
void LldbEngine::handleStateNotification(const GdbMi &item)
|
||||
{
|
||||
QString newState = reportedState.data();
|
||||
const QString newState = item["state"].data();
|
||||
if (newState == "running")
|
||||
notifyInferiorRunOk();
|
||||
else if (newState == "inferiorrunfailed")
|
||||
@@ -867,9 +871,11 @@ void LldbEngine::handleStateNotification(const GdbMi &reportedState)
|
||||
notifyInferiorIll();
|
||||
else if (newState == "enginesetupok")
|
||||
notifyEngineSetupOk();
|
||||
else if (newState == "enginesetupfailed")
|
||||
else if (newState == "enginesetupfailed") {
|
||||
Core::AsynchronousMessageBox::critical(adapterStartFailed(),
|
||||
item["error"].data());
|
||||
notifyEngineSetupFailed();
|
||||
else if (newState == "enginerunfailed")
|
||||
} else if (newState == "enginerunfailed")
|
||||
notifyEngineRunFailed();
|
||||
else if (newState == "enginerunandinferiorrunok") {
|
||||
if (runParameters().continueAfterAttach)
|
||||
|
@@ -117,7 +117,7 @@ private:
|
||||
void readLldbStandardOutput();
|
||||
void readLldbStandardError();
|
||||
|
||||
void handleStateNotification(const GdbMi &state);
|
||||
void handleStateNotification(const GdbMi &item);
|
||||
void handleLocationNotification(const GdbMi &location);
|
||||
void handleOutputNotification(const GdbMi &output);
|
||||
|
||||
|
@@ -34,6 +34,7 @@
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
|
||||
namespace QmlDesigner {
|
||||
@@ -282,7 +283,7 @@ void QmlTimelineKeyframeGroup::moveAllKeyframes(qreal offset)
|
||||
for (const ModelNode &childNode : modelNode().defaultNodeListProperty().toModelNodeList()) {
|
||||
auto property = childNode.variantProperty("frame");
|
||||
if (property.isValid())
|
||||
property.setValue(property.value().toReal() + offset);
|
||||
property.setValue(std::round(property.value().toReal() + offset));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,7 +293,7 @@ void QmlTimelineKeyframeGroup::scaleAllKeyframes(qreal factor)
|
||||
auto property = childNode.variantProperty("frame");
|
||||
|
||||
if (property.isValid())
|
||||
property.setValue(property.value().toReal() * factor);
|
||||
property.setValue(std::round(property.value().toReal() * factor));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -427,7 +427,7 @@ void BaseFileFind::readCommonSettings(QSettings *settings, const QString &defaul
|
||||
syncComboWithSettings(d->m_filterCombo, d->m_filterSetting);
|
||||
|
||||
QStringList exclusionFilters = settings->value("exclusionFilters").toStringList();
|
||||
if (exclusionFilters.isEmpty())
|
||||
if (!exclusionFilters.contains(defaultExclusionFilter))
|
||||
exclusionFilters << defaultExclusionFilter;
|
||||
const QVariant currentExclusionFilter = settings->value("currentExclusionFilter");
|
||||
d->m_exclusionSetting = currentExclusionFilter.isValid() ? currentExclusionFilter.toString()
|
||||
|
@@ -218,7 +218,7 @@ void FindInFiles::writeSettings(QSettings *settings)
|
||||
void FindInFiles::readSettings(QSettings *settings)
|
||||
{
|
||||
settings->beginGroup(QLatin1String("FindInFiles"));
|
||||
readCommonSettings(settings, "*.cpp,*.h", "*/.git/*,*/.cvs/*,*/.svn/*");
|
||||
readCommonSettings(settings, "*.cpp,*.h", "*/.git/*,*/.cvs/*,*/.svn/*,*.autosave");
|
||||
settings->endGroup();
|
||||
}
|
||||
|
||||
|
@@ -406,12 +406,9 @@ bool FontSettings::loadColorScheme(const QString &fileName,
|
||||
if (!m_scheme.contains(id)) {
|
||||
Format format;
|
||||
const Format &descFormat = desc.format();
|
||||
if (descFormat == format && m_scheme.contains(C_TEXT)) {
|
||||
// Default format -> Text
|
||||
const Format textFormat = m_scheme.formatFor(C_TEXT);
|
||||
format.setForeground(textFormat.foreground());
|
||||
format.setBackground(textFormat.background());
|
||||
} else {
|
||||
// Default fallback for background and foreground is C_TEXT, which is set through
|
||||
// the editor's palette, i.e. we leave these as invalid colors in that case
|
||||
if (descFormat != format || !m_scheme.contains(C_TEXT)) {
|
||||
format.setForeground(descFormat.foreground());
|
||||
format.setBackground(descFormat.background());
|
||||
}
|
||||
|
@@ -4111,12 +4111,12 @@ void TextEditorWidgetPrivate::updateLineAnnotation(const PaintEventData &data,
|
||||
if (!blockUserData)
|
||||
return;
|
||||
|
||||
TextMarks marks = blockUserData->marks();
|
||||
|
||||
const bool annotationsVisible = Utils::anyOf(marks, [](const TextMark* mark) {
|
||||
TextMarks marks = Utils::filtered(blockUserData->marks(), [](const TextMark* mark){
|
||||
return !mark->lineAnnotation().isEmpty();
|
||||
});
|
||||
|
||||
const bool annotationsVisible = !marks.isEmpty();
|
||||
|
||||
if (updateAnnotationBounds(blockUserData, data.documentLayout, annotationsVisible)
|
||||
|| !annotationsVisible) {
|
||||
return;
|
||||
|
@@ -1990,7 +1990,7 @@ void tst_Dumpers::dumper_data()
|
||||
+ CoreProfile()
|
||||
+ Check("f1", "a (1)", TypeDef("QFlags<enum Foo>", "FooFlags")) % CdbEngine
|
||||
+ Check("f1", "a (0x0001)", "FooFlags") % NoCdbEngine
|
||||
+ Check("f2", "a | b (0x0003)", "FooFlags") % GdbEngine;
|
||||
+ Check("f2", "(a | b) (0x0003)", "FooFlags") % GdbEngine;
|
||||
|
||||
QTest::newRow("QDateTime")
|
||||
<< Data("#include <QDateTime>\n",
|
||||
|
@@ -77,8 +77,9 @@ def main():
|
||||
proposalToolTips)
|
||||
correction = testData.field(record, "correction")
|
||||
if correction == 'all':
|
||||
test.compare(len(needCorrection), len(proposalToolTips),
|
||||
"Verifying whether all proposal need correction.")
|
||||
__verifyLineUnderCursor__(cppwindow, record)
|
||||
test.compare(len(needCorrection), 0,
|
||||
"Verifying whether operator has been already corrected.")
|
||||
elif correction == 'mixed':
|
||||
test.verify(len(proposalToolTips) > len(needCorrection) > 0,
|
||||
"Verifying whether some of the proposals need correction.")
|
||||
|
@@ -46,8 +46,9 @@ def commit(commitMessage, expectedLogMessage, uncheckUntracked=False):
|
||||
checkOrFixCommitterInformation('invalidEmailLabel', 'emailLineEdit', 'nobody@nowhere.com')
|
||||
clickButton(waitForObject(":splitter.Commit File(s)_VcsBase::QActionPushButton"))
|
||||
vcsLog = waitForObject("{type='QPlainTextEdit' unnamed='1' visible='1' "
|
||||
"window=':Qt Creator_Core::Internal::MainWindow'}").plainText
|
||||
test.verify(expectedLogMessage in str(vcsLog), "Searching for '%s' in log:\n%s " % (expectedLogMessage, vcsLog))
|
||||
"window=':Qt Creator_Core::Internal::MainWindow'}")
|
||||
test.verify(waitFor('expectedLogMessage in str(vcsLog.plainText)', 2000),
|
||||
"Searching for '%s' in log:\n%s " % (expectedLogMessage, vcsLog.plainText))
|
||||
return commitMessage
|
||||
|
||||
def verifyItemsInGit(commitMessages):
|
||||
|
@@ -235,51 +235,16 @@ TEST_F(CompilerOptionsBuilder, ClangHeadersAndCppIncludesPathsOrderLinux)
|
||||
}
|
||||
|
||||
TEST_F(CompilerOptionsBuilder, ClangHeadersAndCppIncludesPathsOrderNoVersion)
|
||||
{
|
||||
projectPart.headerPaths = {HeaderPath{"C:\\Qt\\Tools\\mingw530_32\\i686-w64-mingw32\\include", HeaderPathType::BuiltIn},
|
||||
HeaderPath{"C:\\Qt\\Tools\\mingw530_32\\i686-w64-mingw32\\include\\c++", HeaderPathType::BuiltIn},
|
||||
HeaderPath{"C:\\Qt\\Tools\\mingw530_32\\i686-w64-mingw32\\include\\c++\\i686-w64-mingw32", HeaderPathType::BuiltIn},
|
||||
HeaderPath{"C:\\Qt\\Tools\\mingw530_32\\i686-w64-mingw32\\include\\c++\\backward", HeaderPathType::BuiltIn}
|
||||
};
|
||||
projectPart.toolChainTargetTriple = "x86_64-w64-windows-gnu";
|
||||
CppTools::CompilerOptionsBuilder compilerOptionsBuilder(projectPart,
|
||||
CppTools::UseSystemHeader::No,
|
||||
CppTools::UseToolchainMacros::Yes,
|
||||
CppTools::UseTweakedHeaderPaths::Yes,
|
||||
CppTools::UseLanguageDefines::No,
|
||||
"7.0.0",
|
||||
"");
|
||||
|
||||
compilerOptionsBuilder.addHeaderPathOptions();
|
||||
|
||||
ASSERT_THAT(compilerOptionsBuilder.options(),
|
||||
ElementsAre("-nostdinc",
|
||||
"-nostdlibinc",
|
||||
"-isystem", QDir::toNativeSeparators("C:\\Qt\\Tools\\mingw530_32\\i686-w64-mingw32\\include"),
|
||||
"-isystem", QDir::toNativeSeparators("C:\\Qt\\Tools\\mingw530_32\\i686-w64-mingw32\\include\\c++"),
|
||||
"-isystem", QDir::toNativeSeparators("C:\\Qt\\Tools\\mingw530_32\\i686-w64-mingw32\\include\\c++\\i686-w64-mingw32"),
|
||||
"-isystem", QDir::toNativeSeparators("C:\\Qt\\Tools\\mingw530_32\\i686-w64-mingw32\\include\\c++\\backward"),
|
||||
"-isystem", QDir::toNativeSeparators(CLANG_RESOURCE_DIR "")));
|
||||
}
|
||||
|
||||
TEST_F(CompilerOptionsBuilder, ClangHeadersAndCppIncludesPathsOrderAndroidClang)
|
||||
{
|
||||
projectPart.headerPaths = {
|
||||
HeaderPath{
|
||||
"C:\\Users\\test\\AppData\\Local\\Android\\sdk\\ndk-bundle\\sysroot\\usr\\include\\i686-linux-android",
|
||||
HeaderPath{"C:/Qt/Tools/mingw530_32/i686-w64-mingw32/include", HeaderPathType::BuiltIn},
|
||||
HeaderPath{"C:/Qt/Tools/mingw530_32/i686-w64-mingw32/include/c++",
|
||||
HeaderPathType::BuiltIn},
|
||||
HeaderPath{
|
||||
"C:\\Users\\test\\AppData\\Local\\Android\\sdk\\ndk-bundle\\sources\\cxx-stl\\llvm-libc++\\include",
|
||||
HeaderPath{"C:/Qt/Tools/mingw530_32/i686-w64-mingw32/include/c++/i686-w64-mingw32",
|
||||
HeaderPathType::BuiltIn},
|
||||
HeaderPath{
|
||||
"C:\\Users\\test\\AppData\\Local\\Android\\sdk\\ndk-bundle\\sources\\android\\support\\include",
|
||||
HeaderPathType::BuiltIn},
|
||||
HeaderPath{
|
||||
"C:\\Users\\test\\AppData\\Local\\Android\\sdk\\ndk-bundle\\sources\\cxx-stl\\llvm-libc++abi\\include",
|
||||
HeaderPathType::BuiltIn},
|
||||
HeaderPath{"C:\\Users\\test\\AppData\\Local\\Android\\sdk\\ndk-bundle\\sysroot\\usr\\include",
|
||||
HeaderPath{"C:/Qt/Tools/mingw530_32/i686-w64-mingw32/include/c++/backward",
|
||||
HeaderPathType::BuiltIn}};
|
||||
projectPart.toolChainTargetTriple = "i686-linux-android";
|
||||
projectPart.toolChainTargetTriple = "x86_64-w64-windows-gnu";
|
||||
CppTools::CompilerOptionsBuilder compilerOptionsBuilder(projectPart,
|
||||
CppTools::UseSystemHeader::No,
|
||||
CppTools::UseToolchainMacros::Yes,
|
||||
@@ -296,22 +261,69 @@ TEST_F(CompilerOptionsBuilder, ClangHeadersAndCppIncludesPathsOrderAndroidClang)
|
||||
"-nostdinc",
|
||||
"-nostdlibinc",
|
||||
"-isystem",
|
||||
QDir::toNativeSeparators(
|
||||
"C:\\Users\\test\\AppData\\Local\\Android\\sdk\\ndk-bundle\\sysroot\\usr\\include\\i686-linux-android"),
|
||||
QDir::toNativeSeparators("C:/Qt/Tools/mingw530_32/i686-w64-mingw32/include/c++"),
|
||||
"-isystem",
|
||||
QDir::toNativeSeparators(
|
||||
"C:\\Users\\test\\AppData\\Local\\Android\\sdk\\ndk-bundle\\sources\\cxx-stl\\llvm-libc++\\include"),
|
||||
"C:/Qt/Tools/mingw530_32/i686-w64-mingw32/include/c++/i686-w64-mingw32"),
|
||||
"-isystem",
|
||||
QDir::toNativeSeparators(
|
||||
"C:\\Users\\test\\AppData\\Local\\Android\\sdk\\ndk-bundle\\sources\\android\\support\\include"),
|
||||
"-isystem",
|
||||
QDir::toNativeSeparators(
|
||||
"C:\\Users\\test\\AppData\\Local\\Android\\sdk\\ndk-bundle\\sources\\cxx-stl\\llvm-libc++abi\\include"),
|
||||
"C:/Qt/Tools/mingw530_32/i686-w64-mingw32/include/c++/backward"),
|
||||
"-isystem",
|
||||
QDir::toNativeSeparators(CLANG_RESOURCE_DIR ""),
|
||||
"-isystem",
|
||||
QDir::toNativeSeparators(
|
||||
"C:\\Users\\test\\AppData\\Local\\Android\\sdk\\ndk-bundle\\sysroot\\usr\\include")));
|
||||
QDir::toNativeSeparators("C:/Qt/Tools/mingw530_32/i686-w64-mingw32/include")));
|
||||
}
|
||||
|
||||
TEST_F(CompilerOptionsBuilder, ClangHeadersAndCppIncludesPathsOrderAndroidClang)
|
||||
{
|
||||
projectPart.headerPaths
|
||||
= {HeaderPath{"C:/Users/test/AppData/Local/Android/sdk/ndk-"
|
||||
"bundle/sysroot/usr/include/i686-linux-android",
|
||||
HeaderPathType::BuiltIn},
|
||||
HeaderPath{"C:/Users/test/AppData/Local/Android/sdk/ndk-bundle/sources/cxx-"
|
||||
"stl/llvm-libc++/include",
|
||||
HeaderPathType::BuiltIn},
|
||||
HeaderPath{"C:/Users/test/AppData/Local/Android/sdk/ndk-"
|
||||
"bundle/sources/android/support/include",
|
||||
HeaderPathType::BuiltIn},
|
||||
HeaderPath{"C:/Users/test/AppData/Local/Android/sdk/ndk-bundle/sources/cxx-"
|
||||
"stl/llvm-libc++abi/include",
|
||||
HeaderPathType::BuiltIn},
|
||||
HeaderPath{
|
||||
"C:/Users/test/AppData/Local/Android/sdk/ndk-bundle/sysroot/usr/include",
|
||||
HeaderPathType::BuiltIn}};
|
||||
projectPart.toolChainTargetTriple = "i686-linux-android";
|
||||
CppTools::CompilerOptionsBuilder compilerOptionsBuilder(projectPart,
|
||||
CppTools::UseSystemHeader::No,
|
||||
CppTools::UseToolchainMacros::Yes,
|
||||
CppTools::UseTweakedHeaderPaths::Yes,
|
||||
CppTools::UseLanguageDefines::No,
|
||||
"7.0.0",
|
||||
"");
|
||||
|
||||
compilerOptionsBuilder.addHeaderPathOptions();
|
||||
|
||||
ASSERT_THAT(
|
||||
compilerOptionsBuilder.options(),
|
||||
ElementsAre("-nostdinc",
|
||||
"-nostdlibinc",
|
||||
"-isystem",
|
||||
QDir::toNativeSeparators("C:/Users/test/AppData/Local/Android/sdk/ndk-"
|
||||
"bundle/sources/cxx-stl/llvm-libc++/include"),
|
||||
"-isystem",
|
||||
QDir::toNativeSeparators("C:/Users/test/AppData/Local/Android/sdk/ndk-"
|
||||
"bundle/sources/cxx-stl/llvm-libc++abi/include"),
|
||||
"-isystem",
|
||||
QDir::toNativeSeparators(CLANG_RESOURCE_DIR ""),
|
||||
"-isystem",
|
||||
QDir::toNativeSeparators("C:/Users/test/AppData/Local/Android/sdk/ndk-"
|
||||
"bundle/sysroot/usr/include/i686-linux-android"),
|
||||
"-isystem",
|
||||
QDir::toNativeSeparators("C:/Users/test/AppData/Local/Android/sdk/ndk-"
|
||||
"bundle/sources/android/support/include"),
|
||||
"-isystem",
|
||||
QDir::toNativeSeparators("C:/Users/test/AppData/Local/Android/sdk/ndk-"
|
||||
"bundle/sysroot/usr/include")));
|
||||
}
|
||||
|
||||
TEST_F(CompilerOptionsBuilder, NoPrecompiledHeader)
|
||||
|
@@ -256,7 +256,7 @@ TEST_F(CompletionChunksToTextConverter, Enumeration)
|
||||
ASSERT_THAT(converter.text(), QStringLiteral("Class"));
|
||||
}
|
||||
|
||||
TEST_F(CompletionChunksToTextConverter, Switch)
|
||||
TEST_F(CompletionChunksToTextConverter, SwitchAsKeyword)
|
||||
{
|
||||
CodeCompletionChunks completionChunks({switchName,
|
||||
leftParen,
|
||||
@@ -273,6 +273,22 @@ TEST_F(CompletionChunksToTextConverter, Switch)
|
||||
ASSERT_THAT(converter.placeholderPositions().at(0), 8);
|
||||
}
|
||||
|
||||
TEST_F(CompletionChunksToTextConverter, SwitchAsName)
|
||||
{
|
||||
CodeCompletionChunks completionChunks({switchName,
|
||||
leftParen,
|
||||
condition,
|
||||
rightParen,
|
||||
leftBrace,
|
||||
verticalSpace,
|
||||
rightBrace});
|
||||
|
||||
const QString text = ClangCodeModel::Internal::CompletionChunksToTextConverter::convertToName(
|
||||
completionChunks);
|
||||
|
||||
ASSERT_THAT(text, QStringLiteral("switch(){}"));
|
||||
}
|
||||
|
||||
TEST_F(CompletionChunksToTextConverter, For)
|
||||
{
|
||||
CodeCompletionChunks completionChunks({forName,
|
||||
|
Reference in New Issue
Block a user