diff --git a/doc/images/qml-link-debugging-library.png b/doc/images/qml-link-debugging-library.png index a6f11db9389..6a600c000df 100644 Binary files a/doc/images/qml-link-debugging-library.png and b/doc/images/qml-link-debugging-library.png differ diff --git a/doc/images/qml-observer-view.png b/doc/images/qml-observer-view.png index f75187ecfca..98a1100af43 100644 Binary files a/doc/images/qml-observer-view.png and b/doc/images/qml-observer-view.png differ diff --git a/doc/images/qml-script-console.png b/doc/images/qml-script-console.png index 08679a60b22..888df2c282d 100644 Binary files a/doc/images/qml-script-console.png and b/doc/images/qml-script-console.png differ diff --git a/doc/images/qtcreator-add-breakpoint.png b/doc/images/qtcreator-add-breakpoint.png index bf245728270..1a399df7b96 100644 Binary files a/doc/images/qtcreator-add-breakpoint.png and b/doc/images/qtcreator-add-breakpoint.png differ diff --git a/doc/images/qtcreator-debug-breakpoints.png b/doc/images/qtcreator-debug-breakpoints.png index f841626ad0a..7594830661c 100644 Binary files a/doc/images/qtcreator-debug-breakpoints.png and b/doc/images/qtcreator-debug-breakpoints.png differ diff --git a/doc/images/qtcreator-debug-stack.png b/doc/images/qtcreator-debug-stack.png index 7efa1a829e5..41288968092 100644 Binary files a/doc/images/qtcreator-debug-stack.png and b/doc/images/qtcreator-debug-stack.png differ diff --git a/doc/images/qtcreator-debugger-attach-to-process-not-yet-started.png b/doc/images/qtcreator-debugger-attach-to-process-not-yet-started.png index 3ef94c537ee..7ce406c2b19 100644 Binary files a/doc/images/qtcreator-debugger-attach-to-process-not-yet-started.png and b/doc/images/qtcreator-debugger-attach-to-process-not-yet-started.png differ diff --git a/doc/images/qtcreator-debugger-attach-to-running-debug-server.png b/doc/images/qtcreator-debugger-attach-to-running-debug-server.png index 1361886b13e..f991aa0cc3f 100644 Binary files a/doc/images/qtcreator-debugger-attach-to-running-debug-server.png and b/doc/images/qtcreator-debugger-attach-to-running-debug-server.png differ diff --git a/doc/images/qtcreator-debugger-attach-to-running.png b/doc/images/qtcreator-debugger-attach-to-running.png index a382405cfc2..6b44f7492fb 100644 Binary files a/doc/images/qtcreator-debugger-attach-to-running.png and b/doc/images/qtcreator-debugger-attach-to-running.png differ diff --git a/doc/images/qtcreator-debugger-cdb-paths.png b/doc/images/qtcreator-debugger-cdb-paths.png index 99ba352fa9f..5a320c576dd 100644 Binary files a/doc/images/qtcreator-debugger-cdb-paths.png and b/doc/images/qtcreator-debugger-cdb-paths.png differ diff --git a/doc/images/qtcreator-debugger-expressions.png b/doc/images/qtcreator-debugger-expressions.png index 84a3abbefd7..ef9e972071c 100644 Binary files a/doc/images/qtcreator-debugger-expressions.png and b/doc/images/qtcreator-debugger-expressions.png differ diff --git a/doc/images/qtcreator-debugger-load-core-file.png b/doc/images/qtcreator-debugger-load-core-file.png index b5b44f7a101..72b647d6cea 100644 Binary files a/doc/images/qtcreator-debugger-load-core-file.png and b/doc/images/qtcreator-debugger-load-core-file.png differ diff --git a/doc/images/qtcreator-debugger-start-external.png b/doc/images/qtcreator-debugger-start-external.png index c7b5c55a755..2dc7bff9414 100644 Binary files a/doc/images/qtcreator-debugger-start-external.png and b/doc/images/qtcreator-debugger-start-external.png differ diff --git a/doc/images/qtcreator-debugger-views.png b/doc/images/qtcreator-debugger-views.png index ec6fe7ca705..32e9257269e 100644 Binary files a/doc/images/qtcreator-debugger-views.png and b/doc/images/qtcreator-debugger-views.png differ diff --git a/doc/images/qtcreator-debugging-helper-options.png b/doc/images/qtcreator-debugging-helper-options.png index d4c635b0b8a..25a312f783a 100644 Binary files a/doc/images/qtcreator-debugging-helper-options.png and b/doc/images/qtcreator-debugging-helper-options.png differ diff --git a/doc/images/qtcreator-locals.png b/doc/images/qtcreator-locals.png index 81b407d9731..8907c5a4308 100644 Binary files a/doc/images/qtcreator-locals.png and b/doc/images/qtcreator-locals.png differ diff --git a/doc/images/qtcreator-setting-breakpoint1.png b/doc/images/qtcreator-setting-breakpoint1.png index cad33d2c17e..ebea460bee2 100644 Binary files a/doc/images/qtcreator-setting-breakpoint1.png and b/doc/images/qtcreator-setting-breakpoint1.png differ diff --git a/doc/images/qtcreator-setting-breakpoint2.png b/doc/images/qtcreator-setting-breakpoint2.png index d9d9d13cf40..24fd0053c27 100644 Binary files a/doc/images/qtcreator-setting-breakpoint2.png and b/doc/images/qtcreator-setting-breakpoint2.png differ diff --git a/doc/images/qtcreator-watcher.png b/doc/images/qtcreator-watcher.png index 97b150b5897..166bb902c2d 100644 Binary files a/doc/images/qtcreator-watcher.png and b/doc/images/qtcreator-watcher.png differ diff --git a/doc/images/qtquick-debugging-settings.png b/doc/images/qtquick-debugging-settings.png index 765d188bb8b..0b3d896ca1a 100644 Binary files a/doc/images/qtquick-debugging-settings.png and b/doc/images/qtquick-debugging-settings.png differ diff --git a/doc/images/qtquick-example-qml-inspector.png b/doc/images/qtquick-example-qml-inspector.png index 1f54b49ffb0..de9dd2222ae 100644 Binary files a/doc/images/qtquick-example-qml-inspector.png and b/doc/images/qtquick-example-qml-inspector.png differ diff --git a/doc/images/qtquick-example-setting-breakpoint1.png b/doc/images/qtquick-example-setting-breakpoint1.png index ae3a112f4a7..67da2556c72 100644 Binary files a/doc/images/qtquick-example-setting-breakpoint1.png and b/doc/images/qtquick-example-setting-breakpoint1.png differ diff --git a/doc/images/qtquick-example-setting-breakpoint2.png b/doc/images/qtquick-example-setting-breakpoint2.png index 0294e01ba10..788cacaf659 100644 Binary files a/doc/images/qtquick-example-setting-breakpoint2.png and b/doc/images/qtquick-example-setting-breakpoint2.png differ diff --git a/doc/images/qtquick-example-setting-breakpoint3.png b/doc/images/qtquick-example-setting-breakpoint3.png index fbe700f7e2c..5d197ff92ca 100644 Binary files a/doc/images/qtquick-example-setting-breakpoint3.png and b/doc/images/qtquick-example-setting-breakpoint3.png differ diff --git a/doc/images/qtquick-example-stack.png b/doc/images/qtquick-example-stack.png index 366485a951a..943b0af3d70 100644 Binary files a/doc/images/qtquick-example-stack.png and b/doc/images/qtquick-example-stack.png differ diff --git a/doc/images/samegame.png b/doc/images/samegame.png index faebd518deb..1a811dae185 100644 Binary files a/doc/images/samegame.png and b/doc/images/samegame.png differ diff --git a/doc/src/debugger/creator-debugger-common.qdocinc b/doc/src/debugger/creator-debugger-common.qdocinc index b867818cbef..5ebb66ab154 100644 --- a/doc/src/debugger/creator-debugger-common.qdocinc +++ b/doc/src/debugger/creator-debugger-common.qdocinc @@ -282,7 +282,14 @@ Note that functions used in the expressions are called each time, even if they have side-effects. - All backends support simple C and C++ expressions. Functions can be called + The QML debugger can evaluate JavaScript expressions. + +//! [debugger-expressions] + +//! [debugger-expressions-cpp] + + GDB, LLDB and CDB support the evaluation of simple C and C++ expressions. + Functions can be called only if they are actually compiled into the debugged executable or a library used by the executable. Most notably, inlined functions such as most \c{operator[]} implementations of standard containers are typically \e{not} @@ -318,6 +325,14 @@ however, can be recognized as such. \endtable + \note The set of evaluated expressions is saved in your session. + +//! [debugger-expressions-cpp] + +//! [debugger-qt-basic-objects] + + \section1 Inspecting Basic Qt Objects + The \uicontrol {Locals} and \uicontrol {Expressions} views also provide access to the most powerful feature of the debugger: comprehensive display of data belonging to Qt's basic objects. For example, in case of QObject, instead of @@ -327,7 +342,7 @@ Similarly, instead of displaying many pointers and integers, \QC's debugger displays the contents of a QHash or QMap in an orderly manner. Also, the debugger displays access data for QFileInfo and provides access to the - "real" contents of QVariant. + \e real contents of QVariant. Right-click in the \uicontrol {Locals} or the \uicontrol {Expressions} view to open a context menu that provides additional options for viewing data. The @@ -354,8 +369,5 @@ You can enable tooltips in the main editor displaying this information. For more information, see \l{Showing Tooltips in Debug Mode}. - \note The set of evaluated expressions is saved in your session. - -//! [debugger-expressions] - +//! [debugger-qt-basic-objects] */ diff --git a/doc/src/debugger/creator-only/creator-debugger.qdoc b/doc/src/debugger/creator-only/creator-debugger.qdoc index a8d0d1e0932..8497487fdb0 100644 --- a/doc/src/debugger/creator-only/creator-debugger.qdoc +++ b/doc/src/debugger/creator-only/creator-debugger.qdoc @@ -588,6 +588,8 @@ \include creator-debugger-common.qdocinc debugger-call-stack-trace \include creator-debugger-common.qdocinc debugger-locals \include creator-debugger-common.qdocinc debugger-expressions + \include creator-debugger-common.qdocinc debugger-expressions-cpp + \include creator-debugger-common.qdocinc debugger-qt-basic-objects \section1 Directly Interacting with Native Debuggers diff --git a/doc/src/debugger/qtquick-debugger-example.qdoc b/doc/src/debugger/qtquick-debugger-example.qdoc index 51789173c5c..b07c8eb5756 100644 --- a/doc/src/debugger/qtquick-debugger-example.qdoc +++ b/doc/src/debugger/qtquick-debugger-example.qdoc @@ -87,7 +87,7 @@ \image qtquick-example-stack.png - \li Examine the local variables in the \uicontrol {Locals and Expressions} + \li Examine the local variables in the \uicontrol Locals view. Step through the code to see how the information changes in the view. @@ -105,8 +105,8 @@ \li To remove a breakpoint, right-click it and select \uicontrol {Delete Breakpoint}. - \li Select the \uicontrol {Locals and Expressions} tab to explore the object - structure at runtime: + \li In the \uicontrol Locals view, explore the object structure at + runtime. \image qtquick-example-qml-inspector.png @@ -115,11 +115,11 @@ \li Select \uicontrol Debug > \uicontrol Select to activate selection mode and then click the \uicontrol Menu button to move into the - \uicontrol menuButton component in the - \uicontrol {Locals and Expressions} view and the code editor. + \uicontrol menuButton component in the \uicontrol Locals view and + the code editor. - \li In the \uicontrol {Locals and Expressions} view, double-click the - value of a property to change it. + \li In the \uicontrol Locals view, double-click the value of a property + to change it. \endlist diff --git a/doc/src/debugger/qtquick-debugging.qdoc b/doc/src/debugger/qtquick-debugging.qdoc index 4f2dc30e93b..e237d4ad4a2 100644 --- a/doc/src/debugger/qtquick-debugging.qdoc +++ b/doc/src/debugger/qtquick-debugging.qdoc @@ -162,7 +162,7 @@ \li \l{Local Variables and Function Parameters} {Viewing local variables and function parameters} - \li \l{Inspecting Items}{Evaluating expressions at runtime} + \li \l{Evaluating Expressions} \endlist @@ -170,20 +170,21 @@ \include creator-debugger-common.qdocinc debugger-breakpoints \include creator-debugger-common.qdocinc debugger-call-stack-trace \include creator-debugger-common.qdocinc debugger-locals + \include creator-debugger-common.qdocinc debugger-expressions \endif \section1 Inspecting Items While the application is running, you can use the \uicontrol {Locals} - and \uicontrol{Expressions} views to explore the QML item structure. + view to explore the QML item structure. \image qml-observer-view.png "QML item tree" To keep the application visible while you interact with the debugger, select \uicontrol Debug > \uicontrol {Show Application on Top}. - You can view a QML item in \uicontrol {Locals} and \uicontrol {Expressions} - in the following ways: + You can view a QML item in the \uicontrol {Locals} view in the following + ways: \list diff --git a/share/qtcreator/debugger/README.txt b/share/qtcreator/debugger/README.txt index 0913f39f501..bbebfecac70 100644 --- a/share/qtcreator/debugger/README.txt +++ b/share/qtcreator/debugger/README.txt @@ -5,6 +5,7 @@ session, too. With + python import sys python sys.path.insert(1, '/share/qtcreator/debugger/') python from gdbbridge import * diff --git a/share/qtcreator/debugger/creatortypes.py b/share/qtcreator/debugger/creatortypes.py index 087619eb4a3..5c049e482f8 100644 --- a/share/qtcreator/debugger/creatortypes.py +++ b/share/qtcreator/debugger/creatortypes.py @@ -191,10 +191,19 @@ def qdump__CPlusPlus__Internal__Value(d, value): d.putValue(value["l"]) d.putPlainChildren(value) -def qdump__Utils__FileName(d, value): - d.putStringValue(value) +def qdump__Utils__FilePath(d, value): + try: + if not d.extractPointer(value["m_url"]): # there is no valid URL + d.putStringValue(value["m_data"]) + else: + d.putItem(value["m_url"]) + except: + d.putStringValue(value) # support FileName before 4.10 as well d.putPlainChildren(value) +def qdump__Utils__FileName(d, value): + qdump__Utils__FilePath(d, value) + def qdump__Utils__ElfSection(d, value): d.putByteArrayValue(value["name"]) d.putPlainChildren(value) diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index 586df832c07..341ceb71455 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -1230,12 +1230,28 @@ class DumperBase: ns = self.qtNamespace() if len(ns) > 0 and typeName.startswith(ns): typeName = typeName[len(ns):] - pos = typeName.find('<') - # FIXME: make it recognize foo::bar::iterator? - while pos != -1: - pos1 = typeName.rfind('>', pos) - typeName = typeName[0:pos] + typeName[pos1+1:] - pos = typeName.find('<') + # warn( 'stripping %s' % typeName ) + lvl = 0 + pos = None + stripChunks = [] + sz = len(typeName) + for index in range(0, sz): + s = typeName[index] + if s == '<': + lvl += 1 + if lvl == 1: + pos = index + continue + elif s == '>': + lvl -= 1 + if lvl < 0 : + error("Unbalanced '<' in type, @index %d" % index) + if lvl == 0: + stripChunks.append((pos, index+1)) + if lvl != 0: + error("unbalanced at end of type name") + for (f, l) in reversed(stripChunks): + typeName = typeName[:f] + typeName[l:] return typeName def tryPutPrettyItem(self, typeName, value): diff --git a/share/qtcreator/debugger/pdbbridge.py b/share/qtcreator/debugger/pdbbridge.py index c99e812b277..fd9bef48cba 100644 --- a/share/qtcreator/debugger/pdbbridge.py +++ b/share/qtcreator/debugger/pdbbridge.py @@ -34,6 +34,7 @@ import string import inspect import traceback import fnmatch +import platform class QuitException(Exception): @@ -278,6 +279,8 @@ class QtcInternalDumper: if not canonic: canonic = os.path.abspath(filename) canonic = os.path.normcase(canonic) + if platform.system() in ('Microsoft', 'Windows'): + canonic = canonic.replace('\\', '/') self.fncache[filename] = canonic return canonic diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index 95217cf3b95..317b3d343ae 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -1207,7 +1207,7 @@ def qdump__QObjectPrivate__ConnectionList(d, value): with Children(d): first, last = value.split('pp') currentConnection = first - connectionType = d.createType('QObjectPrivate::Connection') + connectionType = d.createType('@QObjectPrivate::Connection') while currentConnection and currentConnection != last: sender, receiver, slotObj, nextConnectionList, nextp, prev = \ d.split('pppppp', currentConnection) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ActionIndicator.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ActionIndicator.qml new file mode 100644 index 00000000000..8be58f0bed6 --- /dev/null +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ActionIndicator.qml @@ -0,0 +1,31 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick 2.1 +import StudioControls 1.0 as StudioControls +import QtQuick.Controls.Styles 1.1 + +StudioControls.ActionIndicator { +} diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/qmldir b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/qmldir index 007fb08d493..f72e226ba05 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/qmldir +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/qmldir @@ -1,3 +1,4 @@ +ActionIndicator 2.0 ActionIndicator.qml AligmentHorizontalButtons 2.0 AligmentHorizontalButtons.qml AligmentVerticalButtons 2.0 AligmentVerticalButtons.qml AnchorButtons 2.0 AnchorButtons.qml diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ActionIndicator.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ActionIndicator.qml index c2a660228d1..6e4f44ae73e 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ActionIndicator.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ActionIndicator.qml @@ -32,14 +32,14 @@ Rectangle { property Item myControl + property bool showBackground: true property alias icon: actionIndicatorIcon property bool hover: false property bool pressed: false - color: StudioTheme.Values.themeControlBackground - border.color: StudioTheme.Values.themeControlOutline - state: "default" + color: actionIndicator.showBackground ? StudioTheme.Values.themeControlBackground : "transparent" + border.color: actionIndicator.showBackground ? StudioTheme.Values.themeControlOutline : "transparent" implicitWidth: StudioTheme.Values.height implicitHeight: StudioTheme.Values.height @@ -55,6 +55,26 @@ Rectangle { font.pixelSize: StudioTheme.Values.myIconFontSize verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter + + states: [ + State { + name: "hovered" + when: actionIndicator.hover && !actionIndicator.pressed + && !myControl.edit && !myControl.drag && myControl.enabled + PropertyChanges { + target: actionIndicatorIcon + scale: 1.2 + } + }, + State { + name: "disabled" + when: !myControl.enabled + PropertyChanges { + target: actionIndicatorIcon + color: StudioTheme.Values.themeTextColorDisabled + } + } + ] } MouseArea { @@ -70,27 +90,18 @@ Rectangle { name: "default" when: myControl.enabled && !actionIndicator.hover && !actionIndicator.pressed && !myControl.hover - && !myControl.edit && !myControl.drag + && !myControl.edit && !myControl.drag && actionIndicator.showBackground PropertyChanges { target: actionIndicator color: StudioTheme.Values.themeControlBackground border.color: StudioTheme.Values.themeControlOutline } }, - State { - name: "hovered" - when: actionIndicator.hover && !actionIndicator.pressed - && !myControl.edit && !myControl.drag - PropertyChanges { - target: actionIndicatorIcon - scale: 1.2 - } - }, State { name: "globalHover" when: myControl.hover && !actionIndicator.hover && !actionIndicator.pressed && !myControl.edit - && !myControl.drag + && !myControl.drag && actionIndicator.showBackground PropertyChanges { target: actionIndicator color: StudioTheme.Values.themeHoverHighlight @@ -99,7 +110,7 @@ Rectangle { }, State { name: "edit" - when: myControl.edit + when: myControl.edit && actionIndicator.showBackground PropertyChanges { target: actionIndicator color: StudioTheme.Values.themeFocusEdit @@ -108,7 +119,7 @@ Rectangle { }, State { name: "drag" - when: myControl.drag + when: myControl.drag && actionIndicator.showBackground PropertyChanges { target: actionIndicator color: StudioTheme.Values.themeFocusDrag @@ -117,16 +128,12 @@ Rectangle { }, State { name: "disabled" - when: !myControl.enabled + when: !myControl.enabled && actionIndicator.showBackground PropertyChanges { target: actionIndicator color: StudioTheme.Values.themeControlBackgroundDisabled border.color: StudioTheme.Values.themeControlOutlineDisabled } - PropertyChanges { - target: actionIndicatorIcon - color: StudioTheme.Values.themeTextColorDisabled - } } ] } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBox.qml index 2f2ebb0541d..cbbf52972e0 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBox.qml @@ -87,7 +87,8 @@ T.ComboBox { color: StudioTheme.Values.themeControlOutline border.color: StudioTheme.Values.themeControlOutline border.width: StudioTheme.Values.border - width: myComboBox.width + x: actionIndicator.width - (actionIndicatorVisible ? StudioTheme.Values.border : 0) + width: myComboBox.width - actionIndicator.width height: myComboBox.height } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBoxInput.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBoxInput.qml index 2ea123f90d2..3485316c3e7 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBoxInput.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBoxInput.qml @@ -74,8 +74,8 @@ TextInput { if (myControl.popup.opened) { myControl.popup.close() } else { - myControl.popup.open() myControl.forceActiveFocus() + myControl.popup.open() } } else { textInput.forceActiveFocus() @@ -106,6 +106,10 @@ TextInput { color: StudioTheme.Values.themeControlBackground border.color: StudioTheme.Values.themeControlOutline } + PropertyChanges { + target: tapHandler + enabled: true + } PropertyChanges { target: mouseArea cursorShape: Qt.PointingHandCursor diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBox.qml index 3c1faec2d8c..d1d738efb4d 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBox.qml @@ -151,7 +151,8 @@ T.SpinBox { color: StudioTheme.Values.themeControlOutline border.color: StudioTheme.Values.themeControlOutline border.width: StudioTheme.Values.border - width: mySpinBox.width + x: actionIndicator.width - (actionIndicatorVisible ? StudioTheme.Values.border : 0) + width: mySpinBox.width - actionIndicator.width height: mySpinBox.height } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxIndicator.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxIndicator.qml index 3ff6b3b3e0f..7cebe1cd262 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxIndicator.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxIndicator.qml @@ -53,7 +53,7 @@ Rectangle { pressAndHoldTimer.stop() } - // This function is meant to synchronize enabled with realEnable to avoid + // This function is meant to synchronize enabled with realEnabled to avoid // the internal logic messing with the actual state. function invalidateEnabled() { spinBoxIndicator.enabled = spinBoxIndicator.realEnabled @@ -191,6 +191,14 @@ Rectangle { target: spinBoxIndicator color: StudioTheme.Values.themeFocusDrag } + }, + State { + name: "disabled" + when: !myControl.enabled + PropertyChanges { + target: spinBoxIndicator + color: StudioTheme.Values.themeControlBackgroundDisabled + } } ] } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBox.qml index c60e7002f26..60d35ac51f5 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBox.qml @@ -143,7 +143,8 @@ T.SpinBox { color: StudioTheme.Values.themeControlOutline border.color: StudioTheme.Values.themeControlOutline border.width: StudioTheme.Values.border - width: mySpinBox.width + x: actionIndicator.width - (actionIndicatorVisible ? StudioTheme.Values.border : 0) + width: mySpinBox.width - actionIndicator.width height: mySpinBox.height } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextField.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextField.qml index 80ca6fd1c7b..7c14e833b96 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextField.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextField.qml @@ -58,9 +58,9 @@ T.TextField { persistentSelection: focus // QTBUG-73807 clip: true + width: StudioTheme.Values.height * 5 height: StudioTheme.Values.height implicitHeight: StudioTheme.Values.height - width: StudioTheme.Values.height * 5 leftPadding: StudioTheme.Values.inputHorizontalPadding + actionIndicator.width - (actionIndicatorVisible ? StudioTheme.Values.border : 0) @@ -108,7 +108,9 @@ T.TextField { color: StudioTheme.Values.themeControlBackground border.color: StudioTheme.Values.themeControlOutline border.width: StudioTheme.Values.border - anchors.fill: parent + x: actionIndicator.width - (actionIndicatorVisible ? StudioTheme.Values.border : 0) + width: myTextField.width - actionIndicator.width + height: myTextField.height } TranslationIndicator { diff --git a/share/qtcreator/themes/flat-dark.creatortheme b/share/qtcreator/themes/flat-dark.creatortheme index e79a96056d9..e281f189aa0 100644 --- a/share/qtcreator/themes/flat-dark.creatortheme +++ b/share/qtcreator/themes/flat-dark.creatortheme @@ -224,7 +224,7 @@ PaletteBrightText=ffff3333 PaletteText=text PaletteButtonText=text PaletteButtonTextDisabled=textDisabled -PaletteToolTipBase=darkBackground +PaletteToolTipBase=shadowBackground PaletteHighlight=selectedBackgroundText PaletteDark=shadowBackground PaletteHighlightedText=textHighlighted diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 3e99abe11ed..dd9cde1e334 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -31,20 +31,19 @@ #include "iplugin.h" #include -#include #include +#include #include +#include #include #include #include #include #include -#include -#include -#include -#include -#include #include +#include +#include +#include #include #include @@ -1175,7 +1174,7 @@ void PluginManagerPrivate::addObject(QObject *obj) if (m_profilingVerbosity && !m_profileTimer.isNull()) { // Report a timestamp when adding an object. Useful for profiling // its initialization time. - const int absoluteElapsedMS = m_profileTimer->elapsed(); + const int absoluteElapsedMS = int(m_profileTimer->elapsed()); qDebug(" %-43s %8dms", obj->metaObject()->className(), absoluteElapsedMS); } @@ -1518,7 +1517,7 @@ PluginSpec *PluginManagerPrivate::pluginByName(const QString &name) const void PluginManagerPrivate::initProfiling() { if (m_profileTimer.isNull()) { - m_profileTimer.reset(new QTime); + m_profileTimer.reset(new QElapsedTimer); m_profileTimer->start(); m_profileElapsedMS = 0; qDebug("Profiling started"); @@ -1530,7 +1529,7 @@ void PluginManagerPrivate::initProfiling() void PluginManagerPrivate::profilingReport(const char *what, const PluginSpec *spec /* = 0 */) { if (!m_profileTimer.isNull()) { - const int absoluteElapsedMS = m_profileTimer->elapsed(); + const int absoluteElapsedMS = int(m_profileTimer->elapsed()); const int elapsedMS = absoluteElapsedMS - m_profileElapsedMS; m_profileElapsedMS = absoluteElapsedMS; if (spec) diff --git a/src/libs/extensionsystem/pluginmanager_p.h b/src/libs/extensionsystem/pluginmanager_p.h index d67ce28c113..95fba4414ad 100644 --- a/src/libs/extensionsystem/pluginmanager_p.h +++ b/src/libs/extensionsystem/pluginmanager_p.h @@ -29,11 +29,12 @@ #include +#include +#include +#include +#include #include #include -#include -#include -#include #include @@ -117,7 +118,7 @@ public: QEventLoop *shutdownEventLoop = nullptr; // used for async shutdown QStringList arguments; - QScopedPointer m_profileTimer; + QScopedPointer m_profileTimer; QHash m_profileTotal; int m_profileElapsedMS = 0; unsigned m_profilingVerbosity = 0; diff --git a/src/libs/modelinglib/qmt/diagram_scene/diagramscenemodel.cpp b/src/libs/modelinglib/qmt/diagram_scene/diagramscenemodel.cpp index 182c251b5d3..82fba740a18 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/diagramscenemodel.cpp +++ b/src/libs/modelinglib/qmt/diagram_scene/diagramscenemodel.cpp @@ -470,10 +470,10 @@ bool DiagramSceneModel::exportPdf(const QString &fileName, bool selectedElements QSizeF pageSize = status.m_sceneBoundingRect.size(); pageSize += QSizeF(2.0 * border, 2.0 * border); pageSize *= scaleFactor; + pageSize *= dotsPerMm; QPdfWriter pdfWriter(fileName); - pdfWriter.setPageSize(QPdfWriter::Custom); - pdfWriter.setPageSizeMM(pageSize * dotsPerMm); + pdfWriter.setPageSize(QPageSize(pageSize, QPageSize::Millimeter)); QPainter pdfPainter; pdfPainter.begin(&pdfWriter); diff --git a/src/plugins/baremetal/iarewtoolchain.cpp b/src/plugins/baremetal/iarewtoolchain.cpp index 3235ee53933..870ab6fd33f 100644 --- a/src/plugins/baremetal/iarewtoolchain.cpp +++ b/src/plugins/baremetal/iarewtoolchain.cpp @@ -66,6 +66,16 @@ static bool compilerExists(const FilePath &compilerPath) return fi.exists() && fi.isExecutable() && fi.isFile(); } +static QString cppLanguageOption(const FilePath &compiler) +{ + const QString baseName = compiler.toFileInfo().baseName(); + if (baseName == "iccarm") + return QString("--c++"); + if (baseName == "icc8051" || baseName == "iccavr") + return QString("--ec++"); + return {}; +} + static Macros dumpPredefinedMacros(const FilePath &compiler, const Core::Id languageId, const QStringList &env) { @@ -87,7 +97,7 @@ static Macros dumpPredefinedMacros(const FilePath &compiler, const Core::Id lang CommandLine cmd(compiler, {fakeIn.fileName()}); if (languageId == ProjectExplorer::Constants::CXX_LANGUAGE_ID) - cmd.addArg("--c++"); + cmd.addArg(cppLanguageOption(compiler)); cmd.addArg("--predef_macros"); cmd.addArg(outpath); @@ -132,7 +142,7 @@ static HeaderPaths dumpHeaderPaths(const FilePath &compiler, const Core::Id lang CommandLine cmd(compiler, {fakeIn.fileName()}); if (languageId == ProjectExplorer::Constants::CXX_LANGUAGE_ID) - cmd.addArg("--c++"); + cmd.addArg(cppLanguageOption(compiler)); cmd.addArg("--preinclude"); cmd.addArg("."); diff --git a/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp b/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp index cb8105a33a1..4307e8b96f7 100644 --- a/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp +++ b/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp @@ -84,15 +84,6 @@ bool writeFile(const QString &filePath, const QByteArray &contents) return true; } -void insertTextAtTopOfEditor(TextEditor::BaseTextEditor *editor, const QByteArray &text) -{ - QTC_ASSERT(editor, return); - ::Utils::ChangeSet cs; - cs.insert(0, QString::fromUtf8(text)); - QTextCursor textCursor = editor->textCursor(); - cs.apply(&textCursor); -} - class ChangeDocumentReloadSetting { public: @@ -697,126 +688,6 @@ void ClangCodeCompletionTest::testCompleteProjectDependingCodeInGeneratedUiFile( QVERIFY(hasItem(proposal, "setupUi")); } -void ClangCodeCompletionTest::testCompleteAfterModifyingIncludedHeaderInOtherEditor() -{ - QSKIP("We don't reparse anymore before a code completion so we get wrong completion results."); - - CppTools::Tests::TemporaryDir temporaryDir; - const TestDocument sourceDocument("mysource.cpp", &temporaryDir); - QVERIFY(sourceDocument.isCreatedAndHasValidCursorPosition()); - const TestDocument headerDocument("myheader.h", &temporaryDir); - QVERIFY(headerDocument.isCreated()); - - // Test that declarations from header file are visible in source file - OpenEditorAtCursorPosition openSource(sourceDocument); - QVERIFY(openSource.succeeded()); - TextEditor::ProposalModelPtr proposal = completionResults(openSource.editor()); - QVERIFY(hasItem(proposal, "globalFromHeader")); - - // Open header and insert a new declaration - OpenEditorAtCursorPosition openHeader(headerDocument); - QVERIFY(openHeader.succeeded()); - insertTextAtTopOfEditor(openHeader.editor(), "int globalFromHeaderUnsaved;\n"); - - // Switch back to source file and check if modified header is reflected in completions. - Core::EditorManager::activateEditor(openSource.editor()); - QCoreApplication::processEvents(); // connections are queued - proposal = completionResults(openSource.editor()); - QVERIFY(hasItem(proposal, "globalFromHeader")); - QVERIFY(hasItem(proposal, "globalFromHeaderUnsaved")); -} - -void ClangCodeCompletionTest::testCompleteAfterModifyingIncludedHeaderByRefactoringActions() -{ - QSKIP("We don't reparse anymore before a code completion so we get wrong completion results."); - - CppTools::Tests::TemporaryDir temporaryDir; - const TestDocument sourceDocument("mysource.cpp", &temporaryDir); - QVERIFY(sourceDocument.isCreatedAndHasValidCursorPosition()); - const TestDocument headerDocument("myheader.h", &temporaryDir); - QVERIFY(headerDocument.isCreated()); - - // Open header - OpenEditorAtCursorPosition openHeader(headerDocument); - QVERIFY(openHeader.succeeded()); - - // Open source and test that declaration from header file is visible in source file - OpenEditorAtCursorPosition openSource(sourceDocument); - QVERIFY(openSource.succeeded()); - TextEditor::ProposalModelPtr proposal = completionResults(openSource.editor()); - QVERIFY(hasItem(proposal, "globalFromHeader")); - - // Modify header document without switching to its editor. - // This simulates e.g. changes from refactoring actions. - ::Utils::ChangeSet cs; - cs.insert(0, QLatin1String("int globalFromHeaderUnsaved;\n")); - QTextCursor textCursor = openHeader.editor()->textCursor(); - cs.apply(&textCursor); - - // Check whether modified header is reflected in the completions. - proposal = completionResults(openSource.editor()); - QVERIFY(hasItem(proposal, "globalFromHeader")); - QVERIFY(hasItem(proposal, "globalFromHeaderUnsaved")); -} - -void ClangCodeCompletionTest::testCompleteAfterChangingIncludedAndOpenHeaderExternally() -{ - QSKIP("The file system watcher is doing it in backend process but we wait not long enough"); - - ChangeDocumentReloadSetting reloadSettingsChanger(Core::IDocument::ReloadUnmodified); - - CppTools::Tests::TemporaryDir temporaryDir; - const TestDocument sourceDocument("mysource.cpp", &temporaryDir); - QVERIFY(sourceDocument.isCreatedAndHasValidCursorPosition()); - const TestDocument headerDocument("myheader.h", &temporaryDir); - QVERIFY(headerDocument.isCreated()); - - // Open header - OpenEditorAtCursorPosition openHeader(headerDocument); - QVERIFY(openHeader.succeeded()); - - // Open source and test completions - OpenEditorAtCursorPosition openSource(sourceDocument); - QVERIFY(openSource.succeeded()); - TextEditor::ProposalModelPtr proposal = completionResults(openSource.editor()); - QVERIFY(hasItem(proposal, "globalFromHeader")); - - // Simulate external modification and wait for reload - WriteFileAndWaitForReloadedDocument waitForReloadedDocument( - headerDocument.filePath, - "int globalFromHeaderReloaded;\n", - openHeader.editor()->document()); - QVERIFY(waitForReloadedDocument.wait()); - - // Retrigger completion and check if its updated - proposal = completionResults(openSource.editor()); - QVERIFY(hasItem(proposal, "globalFromHeaderReloaded")); -} - -void ClangCodeCompletionTest::testCompleteAfterChangingIncludedAndNotOpenHeaderExternally() -{ - QSKIP("The file system watcher is doing it in backend process but we wait not long enough"); - - CppTools::Tests::TemporaryDir temporaryDir; - const TestDocument sourceDocument("mysource.cpp", &temporaryDir); - QVERIFY(sourceDocument.isCreatedAndHasValidCursorPosition()); - const TestDocument headerDocument("myheader.h", &temporaryDir); - QVERIFY(headerDocument.isCreated()); - - // Open source and test completions - OpenEditorAtCursorPosition openSource(sourceDocument); - QVERIFY(openSource.succeeded()); - TextEditor::ProposalModelPtr proposal = completionResults(openSource.editor()); - QVERIFY(hasItem(proposal, "globalFromHeader")); - - // Simulate external modification, e.g version control checkout - QVERIFY(writeFile(headerDocument.filePath, "int globalFromHeaderReloaded;\n")); - - // Retrigger completion and check if its updated - proposal = completionResults(openSource.editor()); - QVERIFY(hasItem(proposal, "globalFromHeaderReloaded")); -} - } // namespace Tests } // namespace Internal } // namespace ClangCodeModel diff --git a/src/plugins/clangcodemodel/test/clangcodecompletion_test.h b/src/plugins/clangcodemodel/test/clangcodecompletion_test.h index b2013550cc3..f2b64048e83 100644 --- a/src/plugins/clangcodemodel/test/clangcodecompletion_test.h +++ b/src/plugins/clangcodemodel/test/clangcodecompletion_test.h @@ -54,11 +54,6 @@ private slots: void testCompleteProjectDependingCode(); void testCompleteProjectDependingCodeAfterChangingProject(); void testCompleteProjectDependingCodeInGeneratedUiFile(); - - void testCompleteAfterModifyingIncludedHeaderInOtherEditor(); - void testCompleteAfterModifyingIncludedHeaderByRefactoringActions(); - void testCompleteAfterChangingIncludedAndOpenHeaderExternally(); - void testCompleteAfterChangingIncludedAndNotOpenHeaderExternally(); }; } // namespace Tests diff --git a/src/plugins/cppeditor/cppuseselections_test.cpp b/src/plugins/cppeditor/cppuseselections_test.cpp index f917c594612..8eb1700a063 100644 --- a/src/plugins/cppeditor/cppuseselections_test.cpp +++ b/src/plugins/cppeditor/cppuseselections_test.cpp @@ -101,7 +101,6 @@ UseSelectionsTestCase::UseSelectionsTestCase(TestDocument &testFile, bool hasTimedOut; const SelectionList selections = waitForUseSelections(&hasTimedOut); QEXPECT_FAIL("non-local use as macro argument - argument expanded 1", "TODO", Abort); - QEXPECT_FAIL("macro use 2", "TODO", Abort); QVERIFY(!hasTimedOut); // foreach (const Selection &selection, selections) // qDebug() << QTest::toString(selection); diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 19bd7c0a52d..74d8d0c5b20 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1430,6 +1430,8 @@ WarningFlags ClangToolChain::warningFlags(const QStringList &cflags) const QStringList ClangToolChain::suggestedMkspecList() const { + if (const ToolChain * const parentTc = ToolChainManager::findToolChain(m_parentToolChainId)) + return parentTc->suggestedMkspecList(); const Abi abi = targetAbi(); if (abi.os() == Abi::DarwinOS) return {"macx-clang", "macx-clang-32", "unsupported/macx-clang", "macx-ios-clang"}; @@ -1664,6 +1666,8 @@ void ClangToolChainConfigWidget::applyImpl() for (const ToolChain *mingwTC : mingwToolChains()) { if (parentId == mingwTC->id()) { tc->m_parentToolChainId = mingwTC->id(); + tc->setTargetAbi(mingwTC->targetAbi()); + tc->setSupportedAbis(mingwTC->supportedAbis()); break; } } diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp index 539c59a0949..c39d6f49698 100644 --- a/src/plugins/projectexplorer/targetsettingspanel.cpp +++ b/src/plugins/projectexplorer/targetsettingspanel.cpp @@ -399,7 +399,7 @@ public: if (role == ContextMenuItemAdderRole) { auto *menu = data.value(); - addToContextMenu(menu); + addToContextMenu(menu, flags(column) & Qt::ItemIsSelectable); return true; } @@ -440,7 +440,7 @@ public: return false; } - void addToContextMenu(QMenu *menu) + void addToContextMenu(QMenu *menu, bool isSelectable) { Kit *kit = KitManager::kit(m_kitId); QTC_ASSERT(kit, return); @@ -448,13 +448,13 @@ public: const QString projectName = m_project->displayName(); QAction *enableAction = menu->addAction(tr("Enable Kit \"%1\" for Project \"%2\"").arg(kitName, projectName)); - enableAction->setEnabled(m_kitId.isValid() && !isEnabled()); + enableAction->setEnabled(isSelectable && m_kitId.isValid() && !isEnabled()); QObject::connect(enableAction, &QAction::triggered, [this, kit] { m_project->addTarget(m_project->createTarget(kit)); }); QAction *disableAction = menu->addAction(tr("Disable Kit \"%1\" for Project \"%2\"").arg(kitName, projectName)); - disableAction->setEnabled(m_kitId.isValid() && isEnabled()); + disableAction->setEnabled(isSelectable && m_kitId.isValid() && isEnabled()); QObject::connect(disableAction, &QAction::triggered, m_project, [this] { Target *t = target(); QTC_ASSERT(t, return); diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index f4c7635eaba..dc974eab3e2 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -275,6 +275,8 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor ProjectExplorer::Abi::abiFromTargetTriplet(mainTc->originalTargetTriple()) || targetAbi.osFlavor() == ProjectExplorer::Abi::AndroidLinuxFlavor) { data.insert(QLatin1String(QBS_ARCHITECTURE), architecture(mainTc->targetAbi())); + } else if (archs.count() == 1) { + data.insert(QLatin1String(QBS_ARCHITECTURE), archs.first()); } data.insert(QLatin1String(QBS_TARGETPLATFORM), targetPlatform(targetAbi, k)); diff --git a/src/plugins/resourceeditor/resourcenode.cpp b/src/plugins/resourceeditor/resourcenode.cpp index 8444b070681..13d23eee23f 100644 --- a/src/plugins/resourceeditor/resourcenode.cpp +++ b/src/plugins/resourceeditor/resourcenode.cpp @@ -234,6 +234,7 @@ ResourceTopLevelNode::ResourceTopLevelNode(const FilePath &filePath, setPriority(Node::DefaultFilePriority); setListInProject(true); setAddFileFilter("*.png; *.jpg; *.gif; *.svg; *.ico; *.qml; *.qml.ui"); + setShowWhenEmpty(true); if (!filePath.isEmpty()) { QFileInfo fi = filePath.toFileInfo(); @@ -470,7 +471,6 @@ ResourceFolderNode::ResourceFolderNode(const QString &prefix, const QString &lan m_prefix(prefix), m_lang(lang) { - setShowWhenEmpty(true); } ResourceFolderNode::~ResourceFolderNode() = default; diff --git a/src/plugins/todo/optionsdialog.cpp b/src/plugins/todo/optionsdialog.cpp index dcffcf4f3e8..706f67cd18a 100644 --- a/src/plugins/todo/optionsdialog.cpp +++ b/src/plugins/todo/optionsdialog.cpp @@ -75,7 +75,7 @@ void OptionsDialog::addToKeywordsList(const Keyword &keyword) QListWidgetItem *item = new QListWidgetItem( icon(keyword.iconType), keyword.name); item->setData(Qt::UserRole, static_cast(keyword.iconType)); - item->setTextColor(keyword.color); + item->setForeground(keyword.color); ui->keywordsList->addItem(item); } @@ -179,7 +179,7 @@ Settings OptionsDialog::settingsFromUi() Keyword keyword; keyword.name = item->text(); keyword.iconType = static_cast(item->data(Qt::UserRole).toInt()); - keyword.color = item->textColor(); + keyword.color = item->foreground().color(); settings.keywords << keyword; } diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index a0eea63b82a..8250891b717 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -97,7 +97,7 @@ def __createProjectOrFileSelectType__(category, template, fromWelcome = False, i clickButton(waitForObject("{text='Choose...' type='QPushButton' unnamed='1' visible='1'}")) return __getSupportedPlatforms__(str(text), template)[0] -def __createProjectSetNameAndPath__(path, projectName = None, checks = True, libType = None): +def __createProjectSetNameAndPath__(path, projectName = None, checks = True): directoryEdit = waitForObject("{type='Utils::FancyLineEdit' unnamed='1' visible='1' " "toolTip?='Full path: *'}") replaceEditorContent(directoryEdit, path) @@ -113,10 +113,6 @@ def __createProjectSetNameAndPath__(path, projectName = None, checks = True, lib test.verify(labelCheck, "Project name and base directory without warning or error") # make sure this is not set as default location ensureChecked("{type='QCheckBox' name='projectsDirectoryCheckBox' visible='1'}", False) - if libType != None: - selectFromCombo(waitForObject("{leftWidget={text='Type' type='QLabel' unnamed='1' " - "visible='1'} type='QComboBox' unnamed='1' visible='1'}"), - LibType.getStringForLib(libType)) clickButton(waitForObject(":Next_QPushButton")) return str(projectName) @@ -365,22 +361,28 @@ def createNewCPPLib(projectDir, projectName, className, target, isStatic): libType = LibType.SHARED if projectDir == None: projectDir = tempDir() - projectName = __createProjectSetNameAndPath__(projectDir, projectName, False, libType) - __chooseTargets__(target, available) - snooze(1) - clickButton(waitForObject(":Next_QPushButton")) - __createProjectHandleModuleSelection__(["QtCore"]) + projectName = __createProjectSetNameAndPath__(projectDir, projectName, False) + __handleBuildSystem__(None) + selectFromCombo(waitForObject("{name='Type' type='QComboBox' visible='1' " + "window=':New_ProjectExplorer::JsonWizard'}"), + LibType.getStringForLib(libType)) + __createProjectHandleModuleSelection__("Core") className = __createProjectHandleClassInformation__(className) + __chooseTargets__(target, available) + clickButton(waitForObject(":Next_QPushButton")) __createProjectHandleLastPage__() return projectName, className def createNewQtPlugin(projectDir, projectName, className, target, baseClass="QGenericPlugin"): available = __createProjectOrFileSelectType__(" Library", "C++ Library", False, True) - projectName = __createProjectSetNameAndPath__(projectDir, projectName, False, LibType.QT_PLUGIN) - __chooseTargets__(target, available) - snooze(1) - clickButton(waitForObject(":Next_QPushButton")) + projectName = __createProjectSetNameAndPath__(projectDir, projectName, False) + __handleBuildSystem__(None) + selectFromCombo(waitForObject("{name='Type' type='QComboBox' visible='1' " + "window=':New_ProjectExplorer::JsonWizard'}"), + LibType.getStringForLib(LibType.QT_PLUGIN)) className = __createProjectHandleClassInformation__(className, baseClass) + __chooseTargets__(target, available) + clickButton(waitForObject(":Next_QPushButton")) __createProjectHandleLastPage__() return projectName, className @@ -422,36 +424,18 @@ def __chooseTargets__(targets, availableTargets=None, additionalFunc=None): test.warning("Target '%s' is not set up correctly." % Targets.getStringForTarget(current)) return checkedTargets -def __createProjectHandleModuleSelection__(modules): - modulesPage = waitForObject("{type='QmakeProjectManager::Internal::ModulesPage' unnamed='1' " - "visible='1'}") - chckBoxes = filter(lambda x: className(x) == 'QCheckBox', object.children(modulesPage)) - chckBoxLabels = set([str(cb.text) for cb in chckBoxes]) - if not set(modules).issubset(chckBoxLabels): - test.fatal("You want to check module(s) not available at 'Module Selection' page.", - "Not available: %s" % str(set(modules).difference(chckBoxLabels))) - for checkBox in chckBoxes: - test.log("(Un)Checking module checkbox '%s'" % str(checkBox.text)) - ensureChecked(checkBox, str(checkBox.text) in modules, 3000) - clickButton(waitForObject(":Next_QPushButton")) +def __createProjectHandleModuleSelection__(module): + selectFromCombo(waitForObject("{name='LibraryQtModule' type='QComboBox' visible='1' " + "window=':New_ProjectExplorer::JsonWizard'}"), module) def __createProjectHandleClassInformation__(className, baseClass=None): if baseClass: - selectFromCombo("{name='baseClassComboBox' type='QComboBox' visible='1'}", baseClass) - classLineEd = waitForObject("{name='classLineEdit' type='Utils::ClassNameValidatingLineEdit' " - "visible='1'}") - result = str(classLineEd.text) - if className: - replaceEditorContent(classLineEd, className) - try: - waitForObject("{text='The class name contains invalid characters.' type='QLabel' " - "unnamed='1' visible='1'}", 1000) - test.fatal("Class name contains invalid characters - using default.") - replaceEditorContent(classLineEd, result) - except: - result = className + selectFromCombo("{name='BaseClassInfo' type='QComboBox' visible='1' " + "window=':New_ProjectExplorer::JsonWizard'}", baseClass) + replaceEditorContent(waitForObject("{name='Class' type='Utils::FancyLineEdit' visible='1' " + "window=':New_ProjectExplorer::JsonWizard'}"), className) clickButton(waitForObject(":Next_QPushButton")) - return result + return className def waitForProcessRunning(running=True): outputButton = waitForObject(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton") diff --git a/tests/system/suite_general/tst_create_proj_wizard/test.py b/tests/system/suite_general/tst_create_proj_wizard/test.py index e3bee3b2a4d..7490427692b 100644 --- a/tests/system/suite_general/tst_create_proj_wizard/test.py +++ b/tests/system/suite_general/tst_create_proj_wizard/test.py @@ -81,8 +81,13 @@ def main(): # are there more Quick combinations - then recreate this project if counter < len(qtVersionsForQuick) - 1: displayedPlatforms = __createProject__(category, template) - continue - handleBuildSystemVerifyKits(category, template, kits, displayedPlatforms) + elif template in ("Qt Widgets Application", "C++ Library"): + def skipDetails(_): + clickButton(waitForObject(":Next_QPushButton")) + handleBuildSystemVerifyKits(category, template, kits, + displayedPlatforms, skipDetails) + else: + handleBuildSystemVerifyKits(category, template, kits, displayedPlatforms) invokeMenuItem("File", "Exit") diff --git a/tests/system/suite_general/tst_installed_languages/testdata/languages.tsv b/tests/system/suite_general/tst_installed_languages/testdata/languages.tsv index 6de7b8fc235..fb8aa0c011c 100644 --- a/tests/system/suite_general/tst_installed_languages/testdata/languages.tsv +++ b/tests/system/suite_general/tst_installed_languages/testdata/languages.tsv @@ -1,5 +1,5 @@ "language" "Exit" "ISO" -"Czech (CzechRepublic)" "Ukončit" "cs_CZ" +"Czech (Czech Republic)" "Ukončit" "cs_CZ" "Danish (Denmark)" "Afslut" "da_DK" "German (Germany)" "Beenden" "de_DE" "French (France)" "Quitter" "fr_FR"