From ca3881d357d71a7a53959c640932aeaa04a2c659 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 2 Dec 2015 18:51:40 +0100 Subject: [PATCH 01/22] Timeline: Update overview range mover when width changes Change-Id: I231eb8fae65e84007a1678070429414b0f98d396 Task-number: QTCREATORBUG-15441 Reviewed-by: Joerg Bornemann --- src/libs/timeline/qml/Overview.qml | 41 ++++++++++++++++-------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/libs/timeline/qml/Overview.qml b/src/libs/timeline/qml/Overview.qml index f1cd43173aa..63ab18684b3 100644 --- a/src/libs/timeline/qml/Overview.qml +++ b/src/libs/timeline/qml/Overview.qml @@ -39,8 +39,9 @@ Rectangle { property QtObject modelProxy property QtObject zoomer property bool recursionGuard: false + onWidthChanged: updateRangeMover() - function updateRange() { + function updateZoomer() { if (recursionGuard) return; recursionGuard = true; @@ -53,24 +54,26 @@ Rectangle { recursionGuard = false; } + function updateRangeMover() { + if (recursionGuard) + return; + recursionGuard = true; + var newRangeX = (zoomer.rangeStart - zoomer.traceStart) * width / + zoomer.traceDuration; + var newWidth = zoomer.rangeDuration * width / zoomer.traceDuration; + var widthChanged = Math.abs(newWidth - rangeMover.rangeWidth) > 1; + var leftChanged = Math.abs(newRangeX - rangeMover.rangeLeft) > 1; + if (leftChanged) + rangeMover.rangeLeft = newRangeX; + + if (leftChanged || widthChanged) + rangeMover.rangeRight = newRangeX + newWidth; + recursionGuard = false; + } + Connections { target: zoomer - onRangeChanged: { - if (recursionGuard) - return; - recursionGuard = true; - var newRangeX = (zoomer.rangeStart - zoomer.traceStart) * width / - zoomer.traceDuration; - var newWidth = zoomer.rangeDuration * width / zoomer.traceDuration; - var widthChanged = Math.abs(newWidth - rangeMover.rangeWidth) > 1; - var leftChanged = Math.abs(newRangeX - rangeMover.rangeLeft) > 1; - if (leftChanged) - rangeMover.rangeLeft = newRangeX; - - if (leftChanged || widthChanged) - rangeMover.rangeRight = newRangeX + newWidth; - recursionGuard = false; - } + onRangeChanged: updateRangeMover() } TimeDisplay { @@ -185,8 +188,8 @@ Rectangle { RangeMover { id: rangeMover visible: modelProxy.height > 0 - onRangeLeftChanged: overview.updateRange() - onRangeRightChanged: overview.updateRange() + onRangeLeftChanged: overview.updateZoomer() + onRangeRightChanged: overview.updateZoomer() } Rectangle { From 696b8e9cc6fe105870629d0a882f59360517d4bb Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 1 Dec 2015 14:14:02 +0100 Subject: [PATCH 02/22] Squish: Raise timeout for qml refactoring As the navigation treeview is updated asynchronously this might take more time. Change-Id: I5002fc547158147d921a5d19098f2cfc3a14336f Reviewed-by: Robert Loehning --- tests/system/suite_QMLS/tst_QMLS04/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system/suite_QMLS/tst_QMLS04/test.py b/tests/system/suite_QMLS/tst_QMLS04/test.py index d069f34fd21..fc5cdab4471 100644 --- a/tests/system/suite_QMLS/tst_QMLS04/test.py +++ b/tests/system/suite_QMLS/tst_QMLS04/test.py @@ -60,7 +60,7 @@ def main(): myCompTE = "SampleApp.Resources.qml\\.qrc./.MyComponent\\.qml" # there should be new QML file generated with name "MyComponent.qml" try: - waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", myCompTE, 3000) + waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", myCompTE, 5000) except: try: waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", addBranchWildcardToRoot(myCompTE), 1000) From 9a5abd1467104ed2e1dcacb6caeadf1f2741771d Mon Sep 17 00:00:00 2001 From: Sergey Belyashov Date: Thu, 3 Dec 2015 10:57:53 +0300 Subject: [PATCH 03/22] Russian translation update Change-Id: Ide237337bad6c1642b53ef6ea507605e0cb7f19e Reviewed-by: Denis Shienkov Reviewed-by: Oswald Buddenhagen --- share/qtcreator/translations/qtcreator_ru.ts | 92 ++++++++------------ 1 file changed, 35 insertions(+), 57 deletions(-) diff --git a/share/qtcreator/translations/qtcreator_ru.ts b/share/qtcreator/translations/qtcreator_ru.ts index 2090cf9481c..6a0c46a7476 100644 --- a/share/qtcreator/translations/qtcreator_ru.ts +++ b/share/qtcreator/translations/qtcreator_ru.ts @@ -3744,29 +3744,6 @@ For example, "Revision: 15" will leave the branch at revision 15.Определяет, получает ли флажок фокус при нажатии или нет. - - ClangCodeModel::Diagnostic - - ignored - пропущено - - - note - замечание - - - warning - предупреждение - - - error - ошибка - - - fatal - фатальная ошибка - - ClangCodeModel::Internal::ClangCompletionAssistProcessor @@ -3775,13 +3752,6 @@ For example, "Revision: 15" will leave the branch at revision 15.Находится в %1 - - ClangCodeModel::Internal::ClangIndexer - - Parsing C/C++/ObjC Files - Разбор С/С++/ObjC файлов - - ClangCodeModel::Internal::ClangProjectSettingsPropertiesPage @@ -3815,14 +3785,6 @@ For example, "Revision: 15" will leave the branch at revision 15.Clang Settings Настройки Clang - - Header Files (*.h) - Заголовочные файлы (*.h) - - - All Files (*) - Все файлы (*) - ClangCodeModel::Internal::ModelManagerSupport @@ -3832,21 +3794,6 @@ For example, "Revision: 15" will leave the branch at revision 15.Clang - - ClangCodeModel::Internal::PchManager - - Successfully generated PCH file "%1". - Успешно создан PCH-файл «%1». - - - Failed to generate PCH file "%1". - Не удалось создать PCH-файл «%1». - - - Precompiling - Прекомпиляция - - ClangFormatSettings @@ -17574,6 +17521,37 @@ You can choose between stashing the changes or discarding them. GLSL + + GridLayoutSpecifics + + GridLayout + GridLayout + + + Columns + Столбцы + + + Rows + Строки + + + Flow + Перетекание + + + Layout Direction + Направление компоновки + + + Row Spacing + Межстрочный интервал + + + Column Spacing + Межстолбцовый интервал + + GridSpecifics @@ -24194,7 +24172,7 @@ Preselects a desktop Qt for building the application if available. Stacked - Уложеная + Уложеная Make the new branch depend on the availability of the source branch. @@ -24218,11 +24196,11 @@ Preselects a desktop Qt for building the application if available. Switch checkout - Сменить выгружаемый каталог + Сменить выгружаемый каталог Switch the checkout in the current directory to the new branch. - Переключить выгружаемый каталог текущего каталога на новую. + Переключить выгружаемый каталог текущего каталога на новую. Hardlink @@ -24266,7 +24244,7 @@ Preselects a desktop Qt for building the application if available. Bazaar Clone (Or Branch) - Клонирование Bazaar + Клонирование Bazaar Module: From b6792f095c278f9aa5ac32224b9cd471f9454c8d Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 3 Dec 2015 11:13:42 +0100 Subject: [PATCH 04/22] QMakeStep: Prevent possible crash Task-number: QTCREATORBUG-15443 Change-Id: Ibec61938a911e7265fa1f12c4f3c7b60bf514b7c Reviewed-by: Oswald Buddenhagen Reviewed-by: Orgad Shaneh --- src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp | 3 ++- src/plugins/qmakeprojectmanager/qmakeproject.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index 92a3ac5b538..29492a4c8a0 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -745,9 +745,10 @@ BuildConfiguration *QmakeBuildConfigurationFactory::restore(Target *parent, cons BuildConfiguration::BuildType QmakeBuildConfiguration::buildType() const { + QMakeStep *qs = qmakeStep(); if (qmakeBuildConfiguration() & BaseQtVersion::DebugBuild) return Debug; - else if (qmakeStep()->separateDebugInfo()) + else if (qs && qs->separateDebugInfo()) return Profile; else return Release; diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 561d5535db7..c2b29fea0c5 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -923,8 +923,8 @@ QtSupport::ProFileReader *QmakeProject::createProFileReader(const QmakeProFileNo if (bc) { k = bc->target()->kit(); env = bc->environment(); - if (bc->qmakeStep()) - qmakeArgs = bc->qmakeStep()->parserArguments(); + if (QMakeStep *qs = bc->qmakeStep()) + qmakeArgs = qs->parserArguments(); else qmakeArgs = bc->configCommandLineArguments(); } else { From 8abd9fae80a59853bb693f0e64c9bd3491c1b869 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 26 Oct 2015 18:26:50 +0100 Subject: [PATCH 05/22] Squish: Update openCmakeProject() Change-Id: I21f5e40b2da0b2a9b37752c2f5e15c4efd687ca5 Reviewed-by: Robert Loehning --- tests/system/shared/project.py | 39 +++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index f789b6ea023..f0212e91ffa 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -64,11 +64,26 @@ def openQmakeProject(projectPath, targets=Targets.desktopTargetClasses(), fromWe return checkedTargets def openCmakeProject(projectPath, buildDir): + def additionalFunction(): + pChooser = waitForObject("{leftWidget={text='Default' type='QCheckBox' unnamed='1' " + "visible='1'} type='Utils::PathChooser' unnamed='1' visible='1'}") + lineEdit = getChildByClass(pChooser, "Utils::FancyLineEdit") + replaceEditorContent(lineEdit, buildDir) + # disable all build configurations except "Default" + configs = ['Debug', 'Release', 'Release with Debug Information', 'Minimum Size Release'] + for checkbox in configs: + ensureChecked(waitForObject("{text='%s' type='QCheckBox' unnamed='1' visible='1' " + "window=':Qt Creator_Core::Internal::MainWindow'}" + % checkbox), False) + ensureChecked(waitForObject("{text='Default' type='QCheckBox' unnamed='1' visible='1' " + "window=':Qt Creator_Core::Internal::MainWindow'}"), True) + invokeMenuItem("File", "Open File or Project...") selectFromFileDialog(projectPath) - replaceEditorContent("{type='Utils::FancyLineEdit' unnamed='1' visible='1'" - "window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'}", buildDir) - clickButton(waitForObject(":CMake Wizard.Next_QPushButton")) + __chooseTargets__(0) # uncheck all + __chooseTargets__(Targets.DESKTOP_480_DEFAULT, additionalFunc=additionalFunction) + clickButton(waitForObject("{text='Configure Project' type='QPushButton' unnamed='1' visible='1'" + "window=':Qt Creator_Core::Internal::MainWindow'}")) return __handleCmakeWizardPage__() def __handleCmakeWizardPage__(): @@ -403,7 +418,10 @@ def createNewQtPlugin(projectDir=None, projectName=None, className=None, fromWel # parameter target can be an OR'd value of Targets # parameter availableTargets should be the result of __createProjectOrFileSelectType__() # or use None as a fallback -def __chooseTargets__(targets=Targets.DESKTOP_474_GCC, availableTargets=None): +# parameter additionalFunc function to be executed inside the detailed view of each chosen kit +# if present, 'Details' button will be clicked, function will be executed, +# 'Details' button will be clicked again +def __chooseTargets__(targets=Targets.DESKTOP_474_GCC, availableTargets=None, additionalFunc=None): if availableTargets != None: available = availableTargets else: @@ -419,8 +437,19 @@ def __chooseTargets__(targets=Targets.DESKTOP_474_GCC, availableTargets=None): try: ensureChecked("{type='QCheckBox' text='%s' visible='1'}" % Targets.getStringForTarget(current), mustCheck, 3000) - if (mustCheck): + if mustCheck: checkedTargets.append(current) + + # perform additional function on detailed kits view + if additionalFunc: + detailsWidget = waitForObject("{type='Utils::DetailsWidget' unnamed='1' " + "window=':Qt Creator_Core::Internal::MainWindow' " + "toolTip?='

%s

*' visible='1'}" + % Targets.getStringForTarget(current)) + detailsButton = getChildByClass(detailsWidget, "Utils::DetailsButton") + clickButton(detailsButton) + additionalFunc() + clickButton(detailsButton) except LookupError: if mustCheck: test.fail("Failed to check target '%s'." % Targets.getStringForTarget(current)) From 5345e05f26f6e62a38bbb3ee5901b23bfc4dd2fb Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 3 Dec 2015 14:36:01 +0100 Subject: [PATCH 06/22] TextEditor: Fix unindent on backspace. Task-number: QTCREATORBUG-15250 Change-Id: I4d19ad90098dc64f96b1aa7f728d8f30d05bff6d Reviewed-by: Christian Stenger --- src/plugins/texteditor/tabsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/texteditor/tabsettings.cpp b/src/plugins/texteditor/tabsettings.cpp index edc04739a35..d64a7478f97 100644 --- a/src/plugins/texteditor/tabsettings.cpp +++ b/src/plugins/texteditor/tabsettings.cpp @@ -229,7 +229,7 @@ int TabSettings::columnCountForText(const QString &text, int startColumn) const int TabSettings::spacesLeftFromPosition(const QString &text, int position) { - if (position >= text.size()) + if (position > text.size()) return 0; int i = position; while (i > 0) { From aba62280aee9f086fa2dce6bd6a3a40f7276b27e Mon Sep 17 00:00:00 2001 From: David Fries Date: Wed, 11 Nov 2015 14:59:02 -0600 Subject: [PATCH 07/22] Debugger: Fix compile for g++ 4.7.2 src/plugins/debugger/gdb/gdbengine.cpp: In lambda function: src/plugins/debugger/gdb/gdbengine.cpp:3224:30: error: the value of 'this' is not usable in a constant expression src/plugins/debugger/gdb/gdbengine.cpp:3210:61: note: 'this' was not declared 'constexpr' src/plugins/debugger/gdb/gdbengine.cpp:3231:13: error: 'incmd' was not declared in this scope This reverts one code block of commit 2b16b97f19a93e9dc9b1465e196be1de34cdd4fa Change-Id: Iab7f5ec84e59d9f280e0405cdd82705c14bb2064 Reviewed-by: Christian Stenger --- src/plugins/debugger/gdb/gdbengine.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 1dbe494d462..8ac6c6ce5b0 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -3218,9 +3218,10 @@ void GdbEngine::loadAdditionalQmlStack() return; } // Call the debug function of QML with the context address to obtain the QML stack trace. - runCommand({"-data-evaluate-expression \"qt_v4StackTrace((QV4::ExecutionContext *)0x" - + QByteArray::number(contextAddress, 16) + ")\"", - NoFlags, CB(handleQmlStackTrace)}); + DebuggerCommand cmd("-data-evaluate-expression \"qt_v4StackTrace((QV4::ExecutionContext *)0x" + + QByteArray::number(contextAddress, 16) + ")\""); + cmd.callback = CB(handleQmlStackTrace); + runCommand(cmd); }; runCommand(cmd); } From ac8626aa78d0ae122e22a68fa1f7692d4c303747 Mon Sep 17 00:00:00 2001 From: David Fries Date: Fri, 20 Nov 2015 09:29:51 -0600 Subject: [PATCH 08/22] avoid None.replace in fromNativePath This is with gdb 7.4.1 linked with python 2.7.3 Change-Id: Idf921afd37d72056874c7179c899f62f791f9282 Reviewed-by: Christian Stenger --- share/qtcreator/debugger/gdbbridge.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index fec5102627f..01657d0ee19 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -1633,7 +1633,11 @@ def fromNativePath(str): symtab = sal.symtab if not symtab is None: objfile = fromNativePath(symtab.objfile.filename) - fileName = fromNativePath(symtab.fullname()) + fullname = symtab.fullname() + if fullname is None: + fileName = "" + else: + fileName = fromNativePath(fullname) if self.nativeMixed and functionName == "qt_qmlDebugMessageAvailable": interpreterStack = self.extractInterpreterStack() From cbb3aee07662b59a71e6bd0db43cc1fd1d1e792e Mon Sep 17 00:00:00 2001 From: Denis Shienkov Date: Sun, 29 Nov 2015 18:04:19 +0300 Subject: [PATCH 09/22] BareMetal: Kill the GDB server provider when debugging stopped On Windows when debugging is stopped, the QProcess::terminate() method does nothing. At least it belongs to the started OpenOCD process. It is better to use Utils::QtcProcess with setup of a setUseCtrlCStub(true) instead of QProcess. Change-Id: I954377dc94de77fbae630e096a252530f12aaf2d Reviewed-by: Orgad Shaneh Reviewed-by: Tim Sander --- src/plugins/baremetal/gdbserverproviderprocess.cpp | 10 ++++++++-- src/plugins/baremetal/gdbserverproviderprocess.h | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/plugins/baremetal/gdbserverproviderprocess.cpp b/src/plugins/baremetal/gdbserverproviderprocess.cpp index 650ce92d765..2fc59b994bb 100644 --- a/src/plugins/baremetal/gdbserverproviderprocess.cpp +++ b/src/plugins/baremetal/gdbserverproviderprocess.cpp @@ -45,8 +45,11 @@ GdbServerProviderProcess::GdbServerProviderProcess( const QSharedPointer &device, QObject *parent) : ProjectExplorer::DeviceProcess(device, parent) - , m_process(new QProcess(this)) + , m_process(new Utils::QtcProcess(this)) { + if (Utils::HostOsInfo::isWindowsHost()) + m_process->setUseCtrlCStub(true); + connect(m_process, SIGNAL(error(QProcess::ProcessError)), SIGNAL(error(QProcess::ProcessError))); connect(m_process, SIGNAL(finished(int)), SIGNAL(finished())); @@ -62,7 +65,10 @@ GdbServerProviderProcess::GdbServerProviderProcess( void GdbServerProviderProcess::start(const QString &executable, const QStringList &arguments) { QTC_ASSERT(m_process->state() == QProcess::NotRunning, return); - m_process->start(executable, arguments); + QString args; + Utils::QtcProcess::addArgs(&args, arguments); + m_process->setCommand(executable, args); + m_process->start(); } void GdbServerProviderProcess::interrupt() diff --git a/src/plugins/baremetal/gdbserverproviderprocess.h b/src/plugins/baremetal/gdbserverproviderprocess.h index dcfbb229fb6..5dbc0da2c2e 100644 --- a/src/plugins/baremetal/gdbserverproviderprocess.h +++ b/src/plugins/baremetal/gdbserverproviderprocess.h @@ -33,6 +33,8 @@ #include +namespace Utils { class QtcProcess; } + namespace BareMetal { namespace Internal { @@ -64,7 +66,7 @@ class GdbServerProviderProcess : public ProjectExplorer::DeviceProcess qint64 write(const QByteArray &data); private: - QProcess * const m_process; + Utils::QtcProcess *m_process; }; } // namespace Internal From fb1e9bc7859a4bd76cdad66ee8320498ec782579 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 4 Dec 2015 09:57:47 +0100 Subject: [PATCH 10/22] Version bump Change-Id: Ibca6fcaf2eeb997179fc9dda0f1dc94dd333d973 Reviewed-by: Eike Ziller --- qtcreator.pri | 4 ++-- qtcreator.qbs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/qtcreator.pri b/qtcreator.pri index 20672d3f0d4..3b3810bd850 100644 --- a/qtcreator.pri +++ b/qtcreator.pri @@ -1,8 +1,8 @@ !isEmpty(QTCREATOR_PRI_INCLUDED):error("qtcreator.pri already included") QTCREATOR_PRI_INCLUDED = 1 -QTCREATOR_VERSION = 3.5.82 -QTCREATOR_COMPAT_VERSION = 3.5.82 +QTCREATOR_VERSION = 3.6.0 +QTCREATOR_COMPAT_VERSION = 3.6.0 BINARY_ARTIFACTS_BRANCH = 3.6 # enable c++11 diff --git a/qtcreator.qbs b/qtcreator.qbs index f793768824f..9efbfa251e8 100644 --- a/qtcreator.qbs +++ b/qtcreator.qbs @@ -5,12 +5,12 @@ Project { minimumQbsVersion: "1.4" property bool withAutotests: qbs.buildVariant === "debug" property string ide_version_major: '3' - property string ide_version_minor: '5' - property string ide_version_release: '82' + property string ide_version_minor: '6' + property string ide_version_release: '0' property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release property string ide_compat_version_major: '3' - property string ide_compat_version_minor: '5' - property string ide_compat_version_release: '82' + property string ide_compat_version_minor: '6' + property string ide_compat_version_release: '0' property string qtcreator_compat_version: ide_compat_version_major + '.' + ide_compat_version_minor + '.' + ide_compat_version_release property path ide_source_tree: path property string ide_app_path: qbs.targetOS.contains("osx") ? "" : "bin" From b2f2b927133cbd7ff87efad357771338644f291c Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 30 Nov 2015 14:37:24 +0100 Subject: [PATCH 11/22] Correct CTRL+wheel zoom on touchpad When we get fine-grained scroll events we shouldn't zoom 10% on every event but scale zooming so they add up to 10% for every wheel click. Task-number: QTBUG-49024 Change-Id: I08ac728bf1421148680de8fbbc76054ba2cce884 Reviewed-by: Eike Ziller --- src/plugins/texteditor/texteditor.cpp | 25 ++++++++++++------------- src/plugins/texteditor/texteditor.h | 3 +-- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 081ad2e7571..fcd41336c2b 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -5476,26 +5476,25 @@ void TextEditorWidget::wheelEvent(QWheelEvent *e) return; } - const int delta = e->delta(); - if (delta < 0) - zoomOut(); - else if (delta > 0) - zoomIn(); + const float delta = e->angleDelta().y() / 120.f; + if (delta != 0) + zoomF(delta); return; } QPlainTextEdit::wheelEvent(e); } -void TextEditorWidget::zoomIn() +void TextEditorWidget::zoomF(float delta) { d->clearVisibleFoldedBlock(); - emit requestFontZoom(10); -} - -void TextEditorWidget::zoomOut() -{ - d->clearVisibleFoldedBlock(); - emit requestFontZoom(-10); + float step = 10.f * delta; + // Ensure we always zoom a minimal step in-case the resolution is more than 16x + if (step > 0 && step < 1) + step = 1; + else if (step < 0 && step > -1) + step = -1; + + emit requestFontZoom(step); } void TextEditorWidget::zoomReset() diff --git a/src/plugins/texteditor/texteditor.h b/src/plugins/texteditor/texteditor.h index 9dd8e3b117c..001d1aa07e8 100644 --- a/src/plugins/texteditor/texteditor.h +++ b/src/plugins/texteditor/texteditor.h @@ -378,8 +378,7 @@ public slots: // Qt4-style connect used in EditorConfiguration void circularPaste(); void switchUtf8bom(); - void zoomIn(); - void zoomOut(); + void zoomF(float delta); void zoomReset(); void cutLine(); From ddc43b7329045cc9f12be75821ef140689c6f3b0 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 2 Dec 2015 15:45:18 +0100 Subject: [PATCH 12/22] Fix that html tags instead of F1 button were for QML tool tips Regression introduced by 6ed775f56a17a6fc3bb48323bd43373d8589b7b0 Change-Id: Ibef3453339d431dcd7b890d18c27f42f198070e8 Task-number: QTCREATORBUG-15225 Reviewed-by: Marco Benelli Reviewed-by: Thomas Hartmann Reviewed-by: Robert Loehning Reviewed-by: Eike Ziller --- src/plugins/qmljseditor/qmljshoverhandler.cpp | 2 +- src/plugins/texteditor/basehoverhandler.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/qmljseditor/qmljshoverhandler.cpp b/src/plugins/qmljseditor/qmljshoverhandler.cpp index 7cefaa5a1a1..1015b6b7b25 100644 --- a/src/plugins/qmljseditor/qmljshoverhandler.cpp +++ b/src/plugins/qmljseditor/qmljshoverhandler.cpp @@ -375,7 +375,7 @@ void QmlJSHoverHandler::operateTooltip(TextEditorWidget *editorWidget, const QPo else if (m_colorTip.isValid()) Utils::ToolTip::show(point, m_colorTip, editorWidget); else - Utils::ToolTip::show(point, toolTip(), editorWidget); + BaseHoverHandler::operateTooltip(editorWidget, point); } void QmlJSHoverHandler::prettyPrintTooltip(const Value *value, diff --git a/src/plugins/texteditor/basehoverhandler.h b/src/plugins/texteditor/basehoverhandler.h index eff2b75a06f..dafe0bd0974 100644 --- a/src/plugins/texteditor/basehoverhandler.h +++ b/src/plugins/texteditor/basehoverhandler.h @@ -65,13 +65,13 @@ class TEXTEDITOR_EXPORT BaseHoverHandler : public QObject void setLastHelpItemIdentified(const HelpItem &help); const HelpItem &lastHelpItemIdentified() const; + virtual void decorateToolTip(); + virtual void operateTooltip(TextEditorWidget *editorWidget, const QPoint &point); private: void clear(); void process(TextEditorWidget *widget, int pos); virtual void identifyMatch(TextEditorWidget *editorWidget, int pos) = 0; - virtual void decorateToolTip(); - virtual void operateTooltip(TextEditorWidget *editorWidget, const QPoint &point); bool m_diagnosticTooltip; QString m_toolTip; From 6c4504159a721bfb99fdc4d128fb0997c81ac378 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Thu, 3 Dec 2015 16:50:42 +0100 Subject: [PATCH 13/22] ResourceNode: Fix directory separators Change-Id: I589397178cf4ad749825f004638a2d9852d7f0c3 Reviewed-by: Eike Ziller Reviewed-by: Tobias Hunger --- src/plugins/resourceeditor/resourcenode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/resourceeditor/resourcenode.cpp b/src/plugins/resourceeditor/resourcenode.cpp index 367f8930df2..fae69734afd 100644 --- a/src/plugins/resourceeditor/resourcenode.cpp +++ b/src/plugins/resourceeditor/resourcenode.cpp @@ -122,9 +122,9 @@ ResourceTopLevelNode::ResourceTopLevelNode(const Utils::FileName &filePath, Fold Utils::FileName base = parent->path(); if (filePath.isChildOf(base)) - setDisplayName(filePath.relativeChildPath(base).toString()); + setDisplayName(filePath.relativeChildPath(base).toUserOutput()); else - setDisplayName(filePath.toString()); + setDisplayName(filePath.toUserOutput()); } ResourceTopLevelNode::~ResourceTopLevelNode() From 2e341ffdfef737cb6f3bfb464e4569c6e139597a Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Fri, 4 Dec 2015 11:40:19 +0100 Subject: [PATCH 14/22] Doc: fix QDoc command in a tutorial Change-Id: Id511edfce884130a7c93dc8f51eb156a10b5b73f Reviewed-by: Leena Miettinen --- doc/src/qtquick/qtquick-app-tutorial.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/qtquick/qtquick-app-tutorial.qdoc b/doc/src/qtquick/qtquick-app-tutorial.qdoc index aaa3d81d10d..ba7d2eecd57 100644 --- a/doc/src/qtquick/qtquick-app-tutorial.qdoc +++ b/doc/src/qtquick/qtquick-app-tutorial.qdoc @@ -57,7 +57,7 @@ the QML file). The image appears in \uicontrol Resources. You can also use any other image or a QML type, instead. - \list a + \list 1 \li In the \uicontrol Projects view, double-click the MainForm.ui.qml file to open it in \QMLD. From 2714a7e981c26bf868f7ea904fcd282bf2e00853 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 7 Dec 2015 08:48:27 +0100 Subject: [PATCH 15/22] Debugger: Remove spurious quotes in gdbbridge.py output Breaks the parsing and might trigger an endless loop. Task-number: QTCREATORBUG-15352 Change-Id: I832d26441d8be3339b4de6d59a33c97f1d7124c5 Reviewed-by: Christian Stenger --- share/qtcreator/debugger/gdbbridge.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index 01657d0ee19..9a0f9e2e726 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -471,7 +471,7 @@ def exitSubItem(self, item, exType, exValue, exTraceBack): self.put('type="%s",' % typeName) # str(type.unqualified()) ? if self.currentValue.value is None: - self.put('value="",encoding="%d","numchild="0",' + self.put('value="",encoding="%d",numchild="0",' % SpecialNotAccessibleValue) else: if not self.currentValue.encoding is None: From ea8665c2e22e22de13c87d3a00be7357cc0f4ec5 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 4 Dec 2015 14:36:04 +0100 Subject: [PATCH 16/22] CdbExtension: Make sure watches group is initialized. This fixes a crash that occurs when a debugger was started without an active watch and a watch were added afterwards. Change-Id: I0219a750bae7b433240b22f99b2e8fd8655ca331 Reviewed-by: Christian Stenger --- .../qtcreatorcdbext/qtcreatorcdbextension.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/libs/qtcreatorcdbext/qtcreatorcdbextension.cpp b/src/libs/qtcreatorcdbext/qtcreatorcdbextension.cpp index 5fce7aa9892..0f0aea6e07d 100644 --- a/src/libs/qtcreatorcdbext/qtcreatorcdbextension.cpp +++ b/src/libs/qtcreatorcdbext/qtcreatorcdbextension.cpp @@ -513,14 +513,16 @@ static std::string commandLocals(ExtensionCommandContext &commandExtCtx,PCSTR ar if (watchSynchronization) { watchesSymbolGroup = 0; extCtx.discardWatchesSymbolGroup(); - if (!watcherInameExpressionMap.empty()) { - // Force group into existence - watchesSymbolGroup = extCtx.watchesSymbolGroup(commandExtCtx.symbols(), errorMessage); - if (!watchesSymbolGroup || !watchesSymbolGroup->synchronize(commandExtCtx.symbols(), - watcherInameExpressionMap, - errorMessage)) { - return std::string(); - } + } + + if (watchesSymbolGroup == 0 + && (!watcherInameExpressionMap.empty() || WatchesSymbolGroup::isWatchIname(iname))) { + // Force group into existence + watchesSymbolGroup = extCtx.watchesSymbolGroup(commandExtCtx.symbols(), errorMessage); + if (!watchesSymbolGroup || !watchesSymbolGroup->synchronize(commandExtCtx.symbols(), + watcherInameExpressionMap, + errorMessage)) { + return std::string(); } } From c209aaf22e2c8a6e438037fe509b6d039b18d712 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 2 Dec 2015 20:57:53 +0100 Subject: [PATCH 17/22] Clang: Fix highlighting issues ...for macros, typedefs and enums. Change-Id: I926e7238695caefd7f4463dbe0cf5b428aa98c1a Reviewed-by: Nikolai Kosjar --- .../clanghighlightingmarksreporter.cpp | 2 + .../ipcsource/highlightinginformation.cpp | 3 +- .../data/highlightinginformations.cpp | 25 +++++++++ .../unittest/highlightinginformationstest.cpp | 55 ++++++++++++++++++- 4 files changed, 81 insertions(+), 4 deletions(-) diff --git a/src/plugins/clangcodemodel/clanghighlightingmarksreporter.cpp b/src/plugins/clangcodemodel/clanghighlightingmarksreporter.cpp index 698f158c654..162c78c5c93 100644 --- a/src/plugins/clangcodemodel/clanghighlightingmarksreporter.cpp +++ b/src/plugins/clangcodemodel/clanghighlightingmarksreporter.cpp @@ -62,6 +62,8 @@ CppTools::SemanticHighlighter::Kind toCppToolsSemanticHighlighterKind( case HighlightingType::Label: return SemanticHighlighter::LabelUse; case HighlightingType::Preprocessor: + case HighlightingType::PreprocessorDefinition: + case HighlightingType::PreprocessorExpansion: return SemanticHighlighter::MacroUse; default: return SemanticHighlighter::Unknown; diff --git a/src/tools/clangbackend/ipcsource/highlightinginformation.cpp b/src/tools/clangbackend/ipcsource/highlightinginformation.cpp index a570f3cf5cf..30ade394ec4 100644 --- a/src/tools/clangbackend/ipcsource/highlightinginformation.cpp +++ b/src/tools/clangbackend/ipcsource/highlightinginformation.cpp @@ -130,6 +130,7 @@ HighlightingType HighlightingInformation::referencedTypeKind(const Cursor &curso case CXCursor_ClassDecl: case CXCursor_StructDecl: case CXCursor_UnionDecl: + case CXCursor_TypedefDecl: case CXCursor_TemplateTypeParameter: case CXCursor_TypeAliasDecl: return HighlightingType::Type; case CXCursor_EnumDecl: return HighlightingType::Enumeration; @@ -205,8 +206,8 @@ HighlightingType HighlightingInformation::identifierKind(const Cursor &cursor) c case CXCursor_NamespaceRef: case CXCursor_NamespaceAlias: case CXCursor_TypeAliasDecl: + case CXCursor_TypedefDecl: case CXCursor_ClassTemplate: - case CXCursor_UnexposedDecl: case CXCursor_CXXStaticCastExpr: case CXCursor_CXXReinterpretCastExpr: case CXCursor_ObjCCategoryDecl: diff --git a/tests/unit/unittest/data/highlightinginformations.cpp b/tests/unit/unittest/data/highlightinginformations.cpp index db5f8afde72..ca7eaa392f2 100644 --- a/tests/unit/unittest/data/highlightinginformations.cpp +++ b/tests/unit/unittest/data/highlightinginformations.cpp @@ -399,3 +399,28 @@ void f19() { ScopeClass::ScopeOperator(); } + +namespace TemplateClassNamespace { +template +class TemplateClass +{ + +}; +} + +void f20() +{ + TemplateClassNamespace::TemplateClass TemplateClassDefinition; +} + +void f21() +{ + typedef int TypeDefDeclaration; + TypeDefDeclaration TypeDefDeclarationUsage; +} + +typedef int EnumerationTypeDef; + +enum Enumeration2 : EnumerationTypeDef { + +}; diff --git a/tests/unit/unittest/highlightinginformationstest.cpp b/tests/unit/unittest/highlightinginformationstest.cpp index 0af449e4d44..9413d3a2ff9 100644 --- a/tests/unit/unittest/highlightinginformationstest.cpp +++ b/tests/unit/unittest/highlightinginformationstest.cpp @@ -844,17 +844,17 @@ TEST_F(HighlightingInformations, FriendTypeDeclaration) { const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(350, 28)); - ASSERT_THAT(infos[2], HasType(HighlightingType::Type)); + ASSERT_THAT(infos[2], HasType(HighlightingType::Invalid)); } TEST_F(HighlightingInformations, FriendArgumentTypeDeclaration) { const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(351, 65)); - ASSERT_THAT(infos[6], HasType(HighlightingType::Type)); + ASSERT_THAT(infos[6], HasType(HighlightingType::Invalid)); } -TEST_F(HighlightingInformations, DISABLED_FriendArgumentDeclaration) +TEST_F(HighlightingInformations, FriendArgumentDeclaration) { const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(351, 65)); @@ -903,6 +903,55 @@ TEST_F(HighlightingInformations, ScopeOperator) ASSERT_THAT(infos[1], HasType(HighlightingType::Invalid)); } +TEST_F(HighlightingInformations, TemplateClassNamespace) +{ + const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(413, 78)); + + ASSERT_THAT(infos[0], HasType(HighlightingType::Type)); +} + +TEST_F(HighlightingInformations, TemplateClass) +{ + const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(413, 78)); + + ASSERT_THAT(infos[2], HasType(HighlightingType::Type)); +} + +TEST_F(HighlightingInformations, TemplateClassParameter) +{ + const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(413, 78)); + + ASSERT_THAT(infos[4], HasType(HighlightingType::Type)); +} + +TEST_F(HighlightingInformations, TemplateClassDeclaration) +{ + const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(413, 78)); + + ASSERT_THAT(infos[6], HasType(HighlightingType::LocalVariable)); +} + +TEST_F(HighlightingInformations, TypeDefDeclaration) +{ + const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(418, 36)); + + ASSERT_THAT(infos[2], HasType(HighlightingType::Type)); +} + +TEST_F(HighlightingInformations, TypeDefDeclarationUsage) +{ + const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(419, 48)); + + ASSERT_THAT(infos[0], HasType(HighlightingType::Type)); +} + +TEST_F(HighlightingInformations, DISABLED_EnumerationTypeDef) +{ + const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(424, 41)); + + ASSERT_THAT(infos[3], HasType(HighlightingType::Type)); +} + Data *HighlightingInformations::d; void HighlightingInformations::SetUpTestCase() From 4d4eb4da226b89e8587263147101747aacbe3a77 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Fri, 4 Dec 2015 13:16:39 +0100 Subject: [PATCH 18/22] Squish: Remove pointless tabs from tested code Change-Id: I030aeff529c24730a13087fd9554d1f60a0e7462 Reviewed-by: Christian Stenger --- tests/system/suite_debugger/tst_cli_output_console/test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/system/suite_debugger/tst_cli_output_console/test.py b/tests/system/suite_debugger/tst_cli_output_console/test.py index 7fc062637b9..a3886cd0757 100644 --- a/tests/system/suite_debugger/tst_cli_output_console/test.py +++ b/tests/system/suite_debugger/tst_cli_output_console/test.py @@ -50,9 +50,9 @@ def main(): "#include ", "int main(int, char *argv[])", "{", - ' std::cout << \"' + outputStdOut + '\" << std::endl;', - ' std::cerr << \"' + outputStdErr + '\" << std::endl;', - ' qDebug() << \"' + outputQDebug + '\";']) + 'std::cout << \"' + outputStdOut + '\" << std::endl;', + 'std::cerr << \"' + outputStdErr + '\" << std::endl;', + 'qDebug() << \"' + outputQDebug + '\";']) # Rely on code completion for closing bracket invokeMenuItem("File", "Save All") openDocument(project + "." + project + "\\.pro") From a4231de01cb2708844ef7dbac93de3a7858a2ec3 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Fri, 4 Dec 2015 18:48:04 +0100 Subject: [PATCH 19/22] Squish: Update tst_qml_editor Change-Id: I403b64fc60e3d4f1ad0635ce86190ea89ab49de5 Reviewed-by: Christian Stenger --- tests/system/suite_editors/tst_qml_editor/test.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/system/suite_editors/tst_qml_editor/test.py b/tests/system/suite_editors/tst_qml_editor/test.py index d1afac43fe6..3772a69a4c5 100644 --- a/tests/system/suite_editors/tst_qml_editor/test.py +++ b/tests/system/suite_editors/tst_qml_editor/test.py @@ -132,9 +132,9 @@ def testHovering(): expectedTypes = ["TextTip", "TextTip"] expectedValues = [ {'text':'
FocusScope\n

The FocusScope object explicitly ' - 'creates a focus scope.

  
'}, + 'creates a focus scope.

  '}, {'text':'
Rectangle\n

The Rectangle item provides a filled rectangle with an ' - 'optional border.

  
'} + 'optional border.

  '} ] alternativeValues = [{"text":"FocusScope"}, {"text":"Rectangle"}] verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, expectedValues, alternativeValues) @@ -147,14 +147,14 @@ def testHovering(): {'text':'
boolean

This property indicates whether the item has focus ' 'within the enclosing focus scope. If true, this item will gain active focus when the enclosing ' 'focus scope gains active focus. In the following example, input will be given active focus ' - 'when scope gains active focus.

  scope gains active focus.

  
'}, {'text':'
string

This property holds the color used to fill the rectangle.' - '

  
'}, + '

  '}, {'text':'
State

This property holds a list of states defined by the item.' - '

  
'}, + '

  '}, {'text':'
Transition

This property holds a list of transitions defined by ' - 'the item.

  
'} + 'the item.

  '} ] alternativeValues = [{"text":"boolean"}, {"text":"string"}, {"text":"State"}, {"text":"Transition"}] verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, expectedValues, alternativeValues) From 19d9dc0ce37bdc52f7c5c7e382480052ed463851 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 2 Dec 2015 20:07:29 +0100 Subject: [PATCH 20/22] Clang: Use line and column instead of offset for diagnostics Offsets can be get wrong because of the utf8 <-> utf16 differences. Line and columns are not that sensitive to it. Change-Id: I2e3e8c000621b6d694a4ada6df176f29427794f5 Reviewed-by: Nikolai Kosjar --- .../sourcelocationcontainer.cpp | 22 +++--- .../clangbackendipc/sourcelocationcontainer.h | 6 +- .../clangcodemodel/clangdiagnosticmanager.cpp | 23 +++++-- .../clangeditordocumentprocessor.cpp | 27 ++++++-- .../clangcodemodel/clangfixitoperation.cpp | 15 ++++- .../clangcodemodel/clangfixitoperation.h | 11 +++ .../clangbackend/ipcsource/sourcelocation.cpp | 5 +- .../mockup/texteditor/refactoringchanges.h | 67 ++++++++++++++++++- .../unit/unittest/clangfixitoperationtest.cpp | 57 ++++++++-------- tests/unit/unittest/diagnosticsettest.cpp | 4 +- tests/unit/unittest/diagnostictest.cpp | 4 +- 11 files changed, 179 insertions(+), 62 deletions(-) diff --git a/src/libs/clangbackendipc/sourcelocationcontainer.cpp b/src/libs/clangbackendipc/sourcelocationcontainer.cpp index 82bf23237f3..5647641d121 100644 --- a/src/libs/clangbackendipc/sourcelocationcontainer.cpp +++ b/src/libs/clangbackendipc/sourcelocationcontainer.cpp @@ -39,10 +39,10 @@ namespace ClangBackEnd { SourceLocationContainer::SourceLocationContainer(const Utf8String &filePath, uint line, - uint offset) + uint column) : filePath_(filePath), line_(line), - offset_(offset) + column_(column) { } @@ -57,16 +57,16 @@ uint SourceLocationContainer::line() const } -uint SourceLocationContainer::offset() const +uint SourceLocationContainer::column() const { - return offset_; + return column_; } QDataStream &operator<<(QDataStream &out, const SourceLocationContainer &container) { out << container.filePath_; out << container.line_; - out << container.offset_; + out << container.column_; return out; } @@ -75,7 +75,7 @@ QDataStream &operator>>(QDataStream &in, SourceLocationContainer &container) { in >> container.filePath_; in >> container.line_; - in >> container.offset_; + in >> container.column_; return in; } @@ -87,14 +87,16 @@ bool operator==(const SourceLocationContainer &first, const SourceLocationContai bool operator!=(const SourceLocationContainer &first, const SourceLocationContainer &second) { - return first.offset_ != second.offset_ + return first.line_ != second.line_ + || first.column_ != second.column_ || first.filePath_ != second.filePath_; } bool operator<(const SourceLocationContainer &first, const SourceLocationContainer &second) { return first.filePath_ < second.filePath_ - || (first.filePath_ == second.filePath_ && first.offset_ < second.offset_); + || (first.filePath_ == second.filePath_ && first.line_ < second.line_) + || (first.filePath_ == second.filePath_ && first.line_ == second.line_ && first.column_ < second.column_); } QDebug operator<<(QDebug debug, const SourceLocationContainer &container) @@ -102,7 +104,7 @@ QDebug operator<<(QDebug debug, const SourceLocationContainer &container) debug.nospace() << "SourceLocationContainer(" << container.filePath() << ", " << container.line() << ", " - << container.offset() + << container.column() << ")"; return debug; } @@ -112,7 +114,7 @@ void PrintTo(const SourceLocationContainer &container, ::std::ostream* os) *os << "[" << container.filePath().constData() << ", " << container.line() << ", " - << container.offset() + << container.column() << "]"; } } // namespace ClangBackEnd diff --git a/src/libs/clangbackendipc/sourcelocationcontainer.h b/src/libs/clangbackendipc/sourcelocationcontainer.h index 54e40f479b3..89760da6ef2 100644 --- a/src/libs/clangbackendipc/sourcelocationcontainer.h +++ b/src/libs/clangbackendipc/sourcelocationcontainer.h @@ -51,16 +51,16 @@ class CMBIPC_EXPORT SourceLocationContainer SourceLocationContainer() = default; SourceLocationContainer(const Utf8String &filePath, uint line, - uint offset); + uint column); const Utf8String &filePath() const; uint line() const; - uint offset() const; + uint column() const; private: Utf8String filePath_; uint line_; - uint offset_; + uint column_; }; CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const SourceLocationContainer &container); diff --git a/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp b/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp index 1e94d55aef2..2e4587e4a14 100644 --- a/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp +++ b/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp @@ -38,6 +38,8 @@ #include #include +#include + namespace { QTextEdit::ExtraSelection createExtraSelections(const QTextCharFormat &mainformat, @@ -53,6 +55,14 @@ QTextEdit::ExtraSelection createExtraSelections(const QTextCharFormat &mainforma return extraSelection; } +int positionInText(QTextDocument *textDocument, + const ClangBackEnd::SourceLocationContainer &sourceLocationContainer) +{ + auto textBlock = textDocument->findBlockByNumber(int(sourceLocationContainer.line()) - 1); + + return textBlock.position() + int(sourceLocationContainer.column()) - 1; +} + void addRangeSelections(const ClangBackEnd::DiagnosticContainer &diagnostic, QTextDocument *textDocument, const QTextCharFormat &contextFormat, @@ -61,8 +71,8 @@ void addRangeSelections(const ClangBackEnd::DiagnosticContainer &diagnostic, { for (auto &&range : diagnostic.ranges()) { QTextCursor cursor(textDocument); - cursor.setPosition(int(range.start().offset())); - cursor.setPosition(int(range.end().offset()), QTextCursor::KeepAnchor); + cursor.setPosition(positionInText(textDocument, range.start())); + cursor.setPosition(positionInText(textDocument, range.end()), QTextCursor::KeepAnchor); auto extraSelection = createExtraSelections(contextFormat, cursor, diagnosticText); @@ -70,14 +80,15 @@ void addRangeSelections(const ClangBackEnd::DiagnosticContainer &diagnostic, } } -QTextCursor createSelectionCursor(QTextDocument *textDocument, uint position) +QTextCursor createSelectionCursor(QTextDocument *textDocument, + const ClangBackEnd::SourceLocationContainer &sourceLocationContainer) { QTextCursor cursor(textDocument); - cursor.setPosition(int(position)); + cursor.setPosition(positionInText(textDocument, sourceLocationContainer)); cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor); if (!cursor.hasSelection()) { - cursor.setPosition(int(position) - 1); + cursor.setPosition(positionInText(textDocument, sourceLocationContainer) - 1); cursor.movePosition(QTextCursor::Right, QTextCursor::KeepAnchor, 2); } @@ -122,7 +133,7 @@ void addSelections(const QVector &diagnostics QList &extraSelections) { for (auto &&diagnostic : diagnostics) { - auto cursor = createSelectionCursor(textDocument, diagnostic.location().offset()); + auto cursor = createSelectionCursor(textDocument, diagnostic.location()); auto text = diagnosticText(diagnostic); auto extraSelection = createExtraSelections(mainFormat, cursor, text); diff --git a/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp b/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp index 6dc870b3de2..eb5e6fe199c 100644 --- a/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp +++ b/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp @@ -170,18 +170,37 @@ void ClangEditorDocumentProcessor::updateCodeWarnings(const QVector -toTextEditorBlocks(const QVector &ifdefedOutRanges) +int positionInText(QTextDocument *textDocument, + const ClangBackEnd::SourceLocationContainer &sourceLocationContainer) +{ + auto textBlock = textDocument->findBlockByNumber(int(sourceLocationContainer.line()) - 1); + + return textBlock.position() + int(sourceLocationContainer.column()) - 1; +} + +TextEditor::BlockRange +toTextEditorBlock(QTextDocument *textDocument, + const ClangBackEnd::SourceRangeContainer &sourceRangeContainer) +{ + return TextEditor::BlockRange(positionInText(textDocument, sourceRangeContainer.start()), + positionInText(textDocument, sourceRangeContainer.end())); +} + +QList +toTextEditorBlocks(QTextDocument *textDocument, + const QVector &ifdefedOutRanges) { QList blockRanges; blockRanges.reserve(ifdefedOutRanges.size()); for (const auto &range : ifdefedOutRanges) - blockRanges.append(TextEditor::BlockRange(range.start().offset(),range.end().offset())); + blockRanges.append(toTextEditorBlock(textDocument, range)); return blockRanges; } +} void ClangEditorDocumentProcessor::updateHighlighting( const QVector &highlightingMarks, @@ -189,7 +208,7 @@ void ClangEditorDocumentProcessor::updateHighlighting( uint documentRevision) { if (documentRevision == revision()) { - const auto skippedPreprocessorBlocks = toTextEditorBlocks(skippedPreprocessorRanges); + const auto skippedPreprocessorBlocks = toTextEditorBlocks(textDocument(), skippedPreprocessorRanges); emit ifdefedOutBlocksUpdated(documentRevision, skippedPreprocessorBlocks); m_semanticHighlighter.setHighlightingRunner( diff --git a/src/plugins/clangcodemodel/clangfixitoperation.cpp b/src/plugins/clangcodemodel/clangfixitoperation.cpp index 23834405a93..8bc1ad61d5d 100644 --- a/src/plugins/clangcodemodel/clangfixitoperation.cpp +++ b/src/plugins/clangcodemodel/clangfixitoperation.cpp @@ -32,6 +32,8 @@ #include +#include + namespace ClangCodeModel { ClangFixItOperation::ClangFixItOperation(const Utf8String &filePath, @@ -56,19 +58,26 @@ QString ClangCodeModel::ClangFixItOperation::description() const void ClangFixItOperation::perform() { const TextEditor::RefactoringChanges refactoringChanges; - TextEditor::RefactoringFilePtr refactoringFile = refactoringChanges.file(filePath.toString()); + refactoringFile = refactoringChanges.file(filePath.toString()); refactoringFile->setChangeSet(changeSet()); refactoringFile->apply(); } +QString ClangFixItOperation::refactoringFileContent_forTestOnly() const +{ + return refactoringFile->document()->toPlainText(); +} + Utils::ChangeSet ClangFixItOperation::changeSet() const { Utils::ChangeSet changeSet; for (const auto &fixItContainer : fixItContainers) { const auto range = fixItContainer.range(); - changeSet.replace(range.start().offset(), - range.end().offset(), + const auto start = range.start(); + const auto end = range.end(); + changeSet.replace(refactoringFile->position(start.line(), start.column()), + refactoringFile->position(end.line(), end.column()), fixItContainer.text()); } diff --git a/src/plugins/clangcodemodel/clangfixitoperation.h b/src/plugins/clangcodemodel/clangfixitoperation.h index 1a58ad4220e..def0dacfd59 100644 --- a/src/plugins/clangcodemodel/clangfixitoperation.h +++ b/src/plugins/clangcodemodel/clangfixitoperation.h @@ -34,9 +34,16 @@ #include #include + #include #include +#include + +namespace TextEditor +{ +class RefactoringFile; +} namespace ClangCodeModel { @@ -51,11 +58,15 @@ class ClangFixItOperation : public TextEditor::QuickFixOperation QString description() const override; void perform() override; + QString refactoringFileContent_forTestOnly() const; + +private: Utils::ChangeSet changeSet() const; private: Utf8String filePath; Utf8String fixItText; + QSharedPointer refactoringFile; QVector fixItContainers; }; diff --git a/src/tools/clangbackend/ipcsource/sourcelocation.cpp b/src/tools/clangbackend/ipcsource/sourcelocation.cpp index 92c5464d7f8..19794130b68 100644 --- a/src/tools/clangbackend/ipcsource/sourcelocation.cpp +++ b/src/tools/clangbackend/ipcsource/sourcelocation.cpp @@ -67,7 +67,7 @@ uint SourceLocation::offset() const SourceLocationContainer SourceLocation::toSourceLocationContainer() const { - return SourceLocationContainer(filePath_, line_, offset_); + return SourceLocationContainer(filePath_, line_, column_); } SourceLocation::SourceLocation(CXSourceLocation cxSourceLocation) @@ -94,7 +94,8 @@ SourceLocation::SourceLocation(CXTranslationUnit cxTranslationUnit, line, column)), filePath_(filePath), - line_(line) + line_(line), + column_(column) { } diff --git a/tests/unit/mockup/texteditor/refactoringchanges.h b/tests/unit/mockup/texteditor/refactoringchanges.h index 7a463fdd53f..d0a8ded4331 100644 --- a/tests/unit/mockup/texteditor/refactoringchanges.h +++ b/tests/unit/mockup/texteditor/refactoringchanges.h @@ -31,7 +31,20 @@ #ifndef REFACTORINGCHANGES_H #define REFACTORINGCHANGES_H +#include #include +#include +#include +#include + +#include + +#include + +#include "gtest/gtest.h" +#include "gmock/gmock-matchers.h" +#include "gmock/gmock.h" +#include "gtest-qt-printing.h" QT_BEGIN_NAMESPACE class QString; @@ -47,20 +60,68 @@ class RefactoringFile; class RefactoringChangesData; typedef QSharedPointer RefactoringFilePtr; +using testing::NotNull; + class RefactoringFile { public: - void setChangeSet(const Utils::ChangeSet &) {} - void apply() {} + RefactoringFile(std::unique_ptr &&textDocument) + : textDocument(std::move(textDocument)) + { + } + + const QTextDocument *document() const + { + return textDocument.get(); + } + + void setChangeSet(const Utils::ChangeSet &changes) + { + this->changes = changes; + } + + void apply() + { + QTextCursor textCursor(textDocument.get()); + changes.apply(&textCursor); + changes.clear(); + } + + int position(uint line, uint column) + { + return textDocument->findBlockByNumber(uint(line) - 1).position() + int(column) - 1; + } + +private: + std::unique_ptr textDocument; + Utils::ChangeSet changes; }; +QString readFile(const QString &filePath) +{ + EXPECT_FALSE(filePath.isEmpty()); + + QFile file(filePath); + + EXPECT_TRUE(file.open(QFile::ReadOnly)); + + auto content = file.readAll(); + + EXPECT_FALSE(content.isEmpty()); + + return QString::fromUtf8(content); +} + class RefactoringChanges { public: RefactoringChanges() {} virtual ~RefactoringChanges() {} - RefactoringFilePtr file(const QString &) const { return RefactoringFilePtr(); } + RefactoringFilePtr file(const QString &filePath) const + { + return RefactoringFilePtr(new RefactoringFile(std::unique_ptr(new QTextDocument(readFile(filePath))))); + } }; class RefactoringChangesData diff --git a/tests/unit/unittest/clangfixitoperationtest.cpp b/tests/unit/unittest/clangfixitoperationtest.cpp index 7989b3c839c..fb923ae7828 100644 --- a/tests/unit/unittest/clangfixitoperationtest.cpp +++ b/tests/unit/unittest/clangfixitoperationtest.cpp @@ -58,13 +58,12 @@ QString unsavedFileContent(const QString &unsavedFilePath) return QString::fromUtf8(unsavedFileContentFile.readAll()); } -MATCHER_P2(MatchText, errorText, expectedText, - std::string(negation ? "hasn't" : "has") + " error text:\n" + PrintToString(errorText) + - " and expected text:\n" + PrintToString(expectedText)) +MATCHER_P(MatchText, expectedText, + std::string(negation ? "hasn't" : "has") + + " expected text:\n" + PrintToString(expectedText)) { - QString resultText = errorText; - Utils::ChangeSet changeSet = arg.changeSet(); - changeSet.apply(&resultText); + const ::ClangFixItOperation &operation = arg; + QString resultText = operation.refactoringFileContent_forTestOnly(); if (resultText != expectedText) { *result_listener << "\n" << resultText.toUtf8().constData(); @@ -77,30 +76,31 @@ MATCHER_P2(MatchText, errorText, expectedText, class ClangFixItOperation : public ::testing::Test { protected: - Utf8String filePath; + Utf8String semicolonFilePath{TESTDATA_DIR"/diagnostic_semicolon_fixit.cpp", -1}; + Utf8String compareFilePath{TESTDATA_DIR"/diagnostic_comparison_fixit.cpp", -1}; Utf8String diagnosticText{Utf8StringLiteral("expected ';' at end of declaration")}; FixItContainer semicolonFixItContainer{Utf8StringLiteral(";"), - {{filePath, 3u, 29u}, - {filePath, 3u, 29u}}}; - QString semicolonErrorFile{QString::fromUtf8(TESTDATA_DIR "/diagnostic_semicolon_fixit.cpp")}; + {{semicolonFilePath, 3u, 13u}, + {semicolonFilePath, 3u, 13u}}}; + QString semicolonErrorFile{semicolonFilePath.toString()}; QString semicolonExpectedFile{QString::fromUtf8(TESTDATA_DIR"/diagnostic_semicolon_fixit_expected.cpp")}; - QString compareWarningFile{QString::fromUtf8(TESTDATA_DIR"/diagnostic_comparison_fixit.cpp")}; + QString compareWarningFile{compareFilePath.toString()}; QString compareExpected1File{QString::fromUtf8(TESTDATA_DIR"/diagnostic_comparison_fixit_expected1.cpp")}; QString compareExpected2File{QString::fromUtf8(TESTDATA_DIR"/diagnostic_comparison_fixit_expected2.cpp")}; FixItContainer compareFixItContainer{Utf8StringLiteral("=="), - {{filePath, 4u, 43u}, - {filePath, 4u, 44u}}}; + {{compareFilePath, 4u, 11u}, + {compareFilePath, 4u, 12u}}}; FixItContainer assignmentFixItContainerParenLeft{Utf8StringLiteral("("), - {{filePath, 4u, 41u}, - {filePath, 4u, 41u}}}; + {{compareFilePath, 4u, 9u}, + {compareFilePath, 4u, 9u}}}; FixItContainer assignmentFixItContainerParenRight{Utf8StringLiteral(")"), - {{filePath, 4u, 46u}, - {filePath, 4u, 46u}}}; + {{compareFilePath, 4u, 14u}, + {compareFilePath, 4u, 14u}}}; }; TEST_F(ClangFixItOperation, Description) { - ::ClangFixItOperation operation(filePath, diagnosticText, {semicolonFixItContainer}); + ::ClangFixItOperation operation(semicolonFilePath, diagnosticText, {semicolonFixItContainer}); ASSERT_THAT(operation.description(), QStringLiteral("Apply Fix: expected ';' at end of declaration")); @@ -108,29 +108,32 @@ TEST_F(ClangFixItOperation, Description) TEST_F(ClangFixItOperation, AppendSemicolon) { - ::ClangFixItOperation operation(filePath, diagnosticText, {semicolonFixItContainer}); + ::ClangFixItOperation operation(semicolonFilePath, diagnosticText, {semicolonFixItContainer}); - ASSERT_THAT(operation, MatchText(unsavedFileContent(semicolonErrorFile), - unsavedFileContent(semicolonExpectedFile))); + operation.perform(); + + ASSERT_THAT(operation, MatchText(unsavedFileContent(semicolonExpectedFile))); } TEST_F(ClangFixItOperation, ComparisonVersusAssignmentChooseComparison) { - ::ClangFixItOperation operation(filePath, diagnosticText, {compareFixItContainer}); + ::ClangFixItOperation operation(compareFilePath, diagnosticText, {compareFixItContainer}); + + operation.perform(); - ASSERT_THAT(operation, MatchText(unsavedFileContent(compareWarningFile), - unsavedFileContent(compareExpected1File))); + ASSERT_THAT(operation, MatchText(unsavedFileContent(compareExpected1File))); } TEST_F(ClangFixItOperation, ComparisonVersusAssignmentChooseParentheses) { - ::ClangFixItOperation operation(filePath, + ::ClangFixItOperation operation(compareFilePath, diagnosticText, {assignmentFixItContainerParenLeft, assignmentFixItContainerParenRight}); - ASSERT_THAT(operation, MatchText(unsavedFileContent(compareWarningFile), - unsavedFileContent(compareExpected2File))); + operation.perform(); + + ASSERT_THAT(operation, MatchText(unsavedFileContent(compareExpected2File))); } } diff --git a/tests/unit/unittest/diagnosticsettest.cpp b/tests/unit/unittest/diagnosticsettest.cpp index e1271cbe075..f0741f7f143 100644 --- a/tests/unit/unittest/diagnosticsettest.cpp +++ b/tests/unit/unittest/diagnosticsettest.cpp @@ -186,7 +186,7 @@ DiagnosticContainer DiagnosticSet::expectedDiagnostic(DiagnosticSet::ChildMode c Utf8StringLiteral("Semantic Issue"), {Utf8String(), Utf8String()}, ClangBackEnd::DiagnosticSeverity::Note, - SourceLocationContainer(headerFilePath, 1, 5), + SourceLocationContainer(headerFilePath, 1, 6), {}, {}, {} @@ -199,7 +199,7 @@ DiagnosticContainer DiagnosticSet::expectedDiagnostic(DiagnosticSet::ChildMode c Utf8StringLiteral("Semantic Issue"), {Utf8String(), Utf8String()}, ClangBackEnd::DiagnosticSeverity::Error, - SourceLocationContainer(translationUnitMainFile.filePath(), 3, 53), + SourceLocationContainer(translationUnitMainFile.filePath(), 3, 6), {}, {}, children diff --git a/tests/unit/unittest/diagnostictest.cpp b/tests/unit/unittest/diagnostictest.cpp index bc81ba8d477..f5865b41816 100644 --- a/tests/unit/unittest/diagnostictest.cpp +++ b/tests/unit/unittest/diagnostictest.cpp @@ -196,7 +196,7 @@ DiagnosticContainer Diagnostic::expectedDiagnostic(Diagnostic::ChildMode childMo Utf8StringLiteral("Semantic Issue"), {Utf8String(), Utf8String()}, ClangBackEnd::DiagnosticSeverity::Note, - SourceLocationContainer(translationUnit.filePath(), 2, 14), + SourceLocationContainer(translationUnit.filePath(), 2, 5), {}, {}, {} @@ -210,7 +210,7 @@ DiagnosticContainer Diagnostic::expectedDiagnostic(Diagnostic::ChildMode childMo Utf8StringLiteral("Semantic Issue"), {Utf8String(), Utf8String()}, ClangBackEnd::DiagnosticSeverity::Warning, - SourceLocationContainer(translationUnit.filePath(), 5, 38), + SourceLocationContainer(translationUnit.filePath(), 5, 4), {}, {}, children From 7c08f5a9b0777e606b09bf548a973f2c0818b9ba Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 11 Nov 2015 15:50:32 +0100 Subject: [PATCH 21/22] Debugger: Further improve base class dumping with LLDB ... in the presence of empty base classes. This now actually makes the Inheritance dumper test pass. Change-Id: I92ada5da46accb6e7eaff58ce5dc329484ef0909 Reviewed-by: Christian Stenger --- share/qtcreator/debugger/lldbbridge.py | 7 +++-- tests/auto/debugger/tst_dumpers.cpp | 38 ++++++++++++-------------- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index e49d71730fd..b453b5a8708 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -1123,14 +1123,15 @@ def __init__(self, name, value): self.value = value baseObjects = [] + # GetNumberOfDirectBaseClasses() includes(!) GetNumberOfVirtualBaseClasses() + # so iterating over .GetNumberOfDirectBaseClasses() is correct. for i in xrange(value.GetType().GetNumberOfDirectBaseClasses()): baseClass = value.GetType().GetDirectBaseClassAtIndex(i).GetType() baseChildCount = baseClass.GetNumberOfFields() \ - + baseClass.GetNumberOfDirectBaseClasses() \ - + baseClass.GetNumberOfVirtualBaseClasses() + + baseClass.GetNumberOfDirectBaseClasses() if baseChildCount: + baseObjects.append(ChildItem(baseClass.GetName(), value.GetChildAtIndex(memberBase))) memberBase += 1 - baseObjects.append(ChildItem(baseClass.GetName(), value.GetChildAtIndex(i))) else: # This base object is empty, but exists and will *not* be reported # by value.GetChildCount(). So manually report the empty base class. diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index f55827bfccb..3c44b319c3c 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -5670,11 +5670,18 @@ void tst_Dumpers::dumper_data() "struct Data { Data() : a(42) {} int a; };\n" "struct VEmpty {};\n" "struct VData { VData() : v(42) {} int v; };\n" + "struct S1 : Empty, Data, virtual VEmpty, virtual VData\n" " { S1() : i1(1) {} int i1; };\n" "struct S2 : Empty, Data, virtual VEmpty, virtual VData\n" " { S2() : i2(1) {} int i2; };\n" - "struct Combined : S1, S2 { Combined() : c(1) {} int c; };\n"; + "struct Combined : S1, S2 { Combined() : c(1) {} int c; };\n" + + "struct T1 : virtual VEmpty, virtual VData\n" + " { T1() : i1(1) {} int i1; };\n" + "struct T2 : virtual VEmpty, virtual VData\n" + " { T2() : i2(1) {} int i2; };\n" + "struct TT : T1, T2 { TT() : c(1) {} int c; };\n"; QTest::newRow("Inheritance") << Data(inheritanceData, @@ -5683,30 +5690,19 @@ void tst_Dumpers::dumper_data() "c.S2::a = 43;\n" "c.S1::v = 44;\n" "c.S2::v = 45;\n" - "unused(&c.S2::v);\n") - + NoLldbEngine + "unused(&c.S2::v);\n" + "TT tt;\n" + "tt.T1::v = 44;\n" + "tt.T2::v = 45;\n" + "unused(&tt.T2::v);\n") + Check("c.c", "1", "int") + Check("c.@1.@1.a", "42", "int") + Check("c.@1.@3.v", "45", "int") + Check("c.@2.@1.a", "43", "int") - + Check("c.@2.@3.v", "45", "int"); - - // FIXME: Virtual inheritance doesn't work with LLDB 300 - QTest::newRow("InheritanceLldb") - << Data(inheritanceData, - "Combined c;\n" - "c.S1::a = 42;\n" - "c.S2::a = 43;\n" - "c.S1::v = 44;\n" - "c.S2::v = 45;\n" - "unused(&c.S2::v);\n") - + LldbEngine - + Check("c.c", "1", "int") - + Check("c.@1.@1.a", "42", "int") - //+ Check("c.@1.@4.v", "45", "int") - + Check("c.@2.@1.a", "43", "int"); - //+ Check("c.@2.@4.v", "45", "int"); - + + Check("c.@2.@3.v", "45", "int") + + Check("tt.c", "1", "int") + + Check("tt.@1.@1.v", "45", "int") + + Check("tt.@2.@1.v", "45", "int"); QTest::newRow("Gdb13393") << Data( From 89d8693107e55800e466a5edf5d9454ad1f87c6d Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 7 Dec 2015 12:00:09 +0100 Subject: [PATCH 22/22] Squish: Work around bugs in tst_cli_output_console Change-Id: Ief5f731b3ff84dcbd34f4200acbe2646847c0f1c Reviewed-by: Christian Stenger --- tests/system/shared/classes.py | 5 +++++ tests/system/shared/workarounds.py | 11 +++++++++++ .../suite_debugger/tst_cli_output_console/test.py | 6 ++++++ 3 files changed, 22 insertions(+) diff --git a/tests/system/shared/classes.py b/tests/system/shared/classes.py index ff013241c6f..e5cf6abb7d4 100644 --- a/tests/system/shared/classes.py +++ b/tests/system/shared/classes.py @@ -49,6 +49,11 @@ def desktopTargetClasses(): desktopTargets &= ~Targets.DESKTOP_541_GCC return desktopTargets + @staticmethod + def qt4Classes(): + return (Targets.DESKTOP_474_GCC & Targets.DESKTOP_480_DEFAULT + & Targets.SIMULATOR & Targets.EMBEDDED_LINUX) + @staticmethod def getStringForTarget(target): if target == Targets.DESKTOP_474_GCC: diff --git a/tests/system/shared/workarounds.py b/tests/system/shared/workarounds.py index 29ec1e281f6..cea2ced11aa 100644 --- a/tests/system/shared/workarounds.py +++ b/tests/system/shared/workarounds.py @@ -261,6 +261,7 @@ def __cropAndLog__(self, fetched): def __initBugDict__(self): self.__bugs__= { 'QTCREATORBUG-6853':self._workaroundCreator6853_, + 'QTCREATORBUG-15456':self._workaroundCreator15456_, } # helper function - will be called if no workaround for the requested bug is deposited def _exitFatal_(self, bugType, number): @@ -271,3 +272,13 @@ def _exitFatal_(self, bugType, number): def _workaroundCreator6853_(self, *args): if "Release" in args[0] and platform.system() == "Linux": snooze(2) + + def _workaroundCreator15456_(self, *args): + isMsvc = args[0] + isQt5 = args[1] + config = args[2] + if isMsvc and isQt5 and config != "Release": + unexpectedExitMessage = ("{type='QMessageBox' unnamed='1' visible='1' " + "windowTitle='Unexpected CDB Exit'}") + clickButton(waitForObject("{text='OK' type='QPushButton' unnamed='1' " + "visible='1' window=%s}" % unexpectedExitMessage)) diff --git a/tests/system/suite_debugger/tst_cli_output_console/test.py b/tests/system/suite_debugger/tst_cli_output_console/test.py index a3886cd0757..81ce1566ae3 100644 --- a/tests/system/suite_debugger/tst_cli_output_console/test.py +++ b/tests/system/suite_debugger/tst_cli_output_console/test.py @@ -63,6 +63,10 @@ def main(): if not availableConfigs: test.fatal("Haven't found a suitable Qt version - leaving without building.") for kit, config in availableConfigs: + if (checkedTargets[kit] == Targets.DESKTOP_480_DEFAULT + and config == "Profile" and JIRA.isBugStillOpen(15457)): + test.warning("Skipping MSVC build of Qt 4 because of QTCREATORBUG-15457.") + continue selectBuildConfig(len(checkedTargets), kit, config) test.log("Testing build configuration: " + config) @@ -95,6 +99,8 @@ def main(): invokeMenuItem("Debug", "Start Debugging", "Start Debugging") JIRA.performWorkaroundForBug(6853, JIRA.Bug.CREATOR, config) handleDebuggerWarnings(config, isMsvc) + JIRA.performWorkaroundForBug(15456, JIRA.Bug.CREATOR, isMsvc, + checkedTargets[kit] & ~Targets.qt4Classes(), config) ensureChecked(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton") outputWindow = waitForObject(":Qt Creator_Core::OutputWindow") waitFor("'Debugging has finished' in str(outputWindow.plainText)", 20000)