From ffd38d2a63b5030e9d7a1d51a3a647f17205f62b Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 12 Jun 2019 09:53:54 +0200 Subject: [PATCH 01/29] ClangTools: Use QElapsedTimer instead of QTime and while instead of forever in order to avoid deprecation warnings. Change-Id: I0ada7b334068f2465ab107c198ff44ff8802a8bd Reviewed-by: Nikolai Kosjar --- .../clangtools/clangtoolspreconfiguredsessiontests.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/clangtools/clangtoolspreconfiguredsessiontests.cpp b/src/plugins/clangtools/clangtoolspreconfiguredsessiontests.cpp index 86dc36e1867..d4b4e032726 100644 --- a/src/plugins/clangtools/clangtoolspreconfiguredsessiontests.cpp +++ b/src/plugins/clangtools/clangtoolspreconfiguredsessiontests.cpp @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include @@ -54,10 +54,10 @@ using namespace ProjectExplorer; static bool processEventsUntil(const std::function condition, int timeOutInMs = 30000) { - QTime t; + QElapsedTimer t; t.start(); - forever { + while (true) { if (t.elapsed() > timeOutInMs) return false; From 1957fbd5815ab47ff942e390ea438a5d2e6d0823 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 12 Jun 2019 10:09:41 +0200 Subject: [PATCH 02/29] Core: Use QElapsedTimer instead of QTime Avoids deprecation warning. Change-Id: Ia4858235184369df1ba5d80c5eca71df53287bce Reviewed-by: Eike Ziller --- src/plugins/coreplugin/outputwindow.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/outputwindow.h b/src/plugins/coreplugin/outputwindow.h index 03760cbce3e..f89ad521f7b 100644 --- a/src/plugins/coreplugin/outputwindow.h +++ b/src/plugins/coreplugin/outputwindow.h @@ -30,9 +30,9 @@ #include +#include #include #include -#include namespace Utils { class OutputFormatter; } @@ -100,7 +100,7 @@ protected: private: using QPlainTextEdit::setFont; // call setBaseFont instead, which respects the zoom factor QTimer m_scrollTimer; - QTime m_lastMessage; + QElapsedTimer m_lastMessage; void enableUndoRedo(); QString doNewlineEnforcement(const QString &out); void filterNewContent(); From 3172773f52fc4703631dae2495d15a2b42632d2e Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Fri, 7 Jun 2019 18:24:09 +0200 Subject: [PATCH 03/29] QmlDesigner: Add more studio controls * Add alignment button rows with new controls * Add font style buttons with new controls * Add anchor button rows with new controls * Fix CheckBox error about undefined assignment * Add new colors in ColorLogic * Fix low contrast for edit mode text color ComboBox, SpinBox, LineEdit * Add new icon font * Fix TranslationIcon background color * Some minor import refactoring Change-Id: If014c3351fd33ccaf893a31033c893e13ee04821 Reviewed-by: Thomas Hartmann --- .../QtQuick/AnchorRow.qml | 82 +++++++++++++++++- .../AligmentHorizontalButtons.qml | 77 +++++++++------- .../HelperWidgets/AligmentVerticalButtons.qml | 78 ++++++++++------- .../imports/HelperWidgets/AnchorButtons.qml | 67 ++++++++------ .../HelperWidgets/BoolButtonRowButton.qml | 41 ++++----- .../imports/HelperWidgets/CheckBox.qml | 12 +-- .../imports/HelperWidgets/ColorLogic.qml | 7 +- .../imports/HelperWidgets/ComboBox.qml | 7 +- .../HelperWidgets/ExtendedFunctionLogic.qml | 2 +- .../HelperWidgets/FontStyleButtons.qml | 27 +++--- .../imports/HelperWidgets/LineEdit.qml | 7 +- .../imports/HelperWidgets/SpinBox.qml | 3 +- .../imports/StudioControls/AbstractButton.qml | 1 + .../imports/StudioControls/Button.qml | 5 ++ .../imports/StudioControls/ButtonRow.qml | 3 +- .../StudioControls/TranslationIndicator.qml | 3 +- .../imports/StudioTheme/Constants.qml | 42 +++++---- .../imports/StudioTheme/icons.ttf | Bin 4300 -> 5280 bytes 18 files changed, 308 insertions(+), 156 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AnchorRow.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AnchorRow.qml index 567093359ce..2800f89539e 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AnchorRow.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AnchorRow.qml @@ -29,6 +29,9 @@ import QtQuick.Layouts 1.0 import QtQuick.Controls 1.0 as Controls import QtQuickDesignerTheme 1.0 +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme + RowLayout { id: anchorRow @@ -71,7 +74,7 @@ RowLayout { rows: 2 columns: 2 - Controls.Label { + Label { text: qsTr("Target") color: __defaultTextColor elide: Text.ElideRight @@ -85,7 +88,7 @@ RowLayout { } } - Controls.Label { + Label { text: "Margin" color: __defaultTextColor elide: Text.ElideRight @@ -99,6 +102,80 @@ RowLayout { backendValue: anchorMargin } + StudioControls.ButtonRow { + id: buttonRow + actionIndicatorVisible: false + + property variant relativeTarget: anchorBackend.relativeAnchorTargetTop + + onRelativeTargetChanged: { + + buttonSameEdge.checked = false + buttonCenter.checked = false + buttonOppositeEdge.checked = false + + if (relativeTarget == AnchorBindingProxy.SameEdge) { + if (!invertRelativeTargets) { + buttonSameEdge.checked = true + } else { + buttonOppositeEdge.checked = true + } + } else if (relativeTarget == AnchorBindingProxy.OppositeEdge) { + if (!invertRelativeTargets) { + buttonOppositeEdge.checked = true + } else { + buttonSameEdge.checked = true + } + } else if (relativeTarget == AnchorBindingProxy.Center) { + buttonCenter.checked = true + } + } + + StudioControls.ButtonGroup { + id: group + } + + StudioControls.AbstractButton { + id: buttonSameEdge + buttonIcon: verticalAnchor ? StudioTheme.Constants.anchorTop : StudioTheme.Constants.anchorLeft + checkable: true + autoExclusive: true + StudioControls.ButtonGroup.group: group + //tooltip: verticalAnchor ? qsTr("Anchor to the top of the target.") : qsTr("Anchor to the left of the target.") + onClicked: { + if (!invertRelativeTargets) + sameEdgeButtonClicked(); + else + oppositeEdgeButtonClicked(); + } + } + StudioControls.AbstractButton { + id: buttonCenter + buttonIcon: verticalAnchor ? StudioTheme.Constants.centerVertical : StudioTheme.Constants.centerHorizontal + checkable: true + autoExclusive: true + StudioControls.ButtonGroup.group: group + //tooltip: verticalAnchor ? qsTr("Anchor to the vertical center of the target.") : qsTr("Anchor to the horizontal center of the target.") + onClicked: centerButtonClicked(); + } + StudioControls.AbstractButton { + id: buttonOppositeEdge + buttonIcon: verticalAnchor ? StudioTheme.Constants.anchorBottom : StudioTheme.Constants.anchorRight + checkable: true + autoExclusive: true + StudioControls.ButtonGroup.group: group + //tooltip: verticalAnchor ? qsTr("Anchor to the bottom of the target.") : qsTr("Anchor to the right of the target.") + onClicked: { + if (!invertRelativeTargets) + oppositeEdgeButtonClicked(); + else + sameEdgeButtonClicked(); + } + } + } + + +/* ButtonRow { id: buttonRow @@ -157,6 +234,7 @@ RowLayout { } } } +*/ } } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentHorizontalButtons.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentHorizontalButtons.qml index af29773ce26..bb545d23699 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentHorizontalButtons.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentHorizontalButtons.qml @@ -25,21 +25,12 @@ import QtQuick 2.1 import HelperWidgets 2.0 +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme Row { id: alignmentHorizontalButtons - RoundedPanel { - width: 16 - height: parent.height - roundLeft: true - ExtendedFunctionButton { - x: 2 - anchors.verticalCenter: parent.verticalCenter - backendValue: alignmentHorizontalButtons.backendValue - } - } - property bool blueHighlight: false property variant backendValue: backendValues.horizontalAlignment; @@ -48,19 +39,20 @@ Row { property bool baseStateFlag: isBaseState; + property color __currentColor: blueHighlight ? StudioTheme.Values.themeInteraction : StudioTheme.Values.themeTextColor + onValueChanged: { - buttonRow.initalChecked = 0 - buttonRow.checkedIndex = 0 + buttonAlignLeft.checked = true + buttonAlignHCenter.checked = false + buttonAlignRight.checked = false + if (value !== undefined) { if (value === "AlignLeft") { - buttonRow.initalChecked = 0 - buttonRow.checkedIndex = 0 + buttonAlignLeft.checked = true } else if (value === "AlignHCenter") { - buttonRow.initalChecked = 1 - buttonRow.checkedIndex = 1 + buttonAlignHCenter.checked = true } else if (value === "AlignRight") { - buttonRow.initalChecked = 2 - buttonRow.checkedIndex = 2 + buttonAlignRight.checked = true } } evaluate() @@ -89,27 +81,54 @@ Row { } } - ButtonRow { - id: buttonRow - exclusive: true + ExtendedFunctionLogic { + id: extFuncLogic + backendValue: alignmentHorizontalButtons.backendValue + } - ButtonRowButton { - roundLeftButton: false - iconSource: "image://icons/alignment-left" + (blueHighlight ? "-h" : "") + StudioControls.ButtonRow { + id: buttonRow + actionIndicatorVisible: true + + actionIndicator.icon.color: extFuncLogic.color + actionIndicator.icon.text: extFuncLogic.glyph + actionIndicator.onClicked: extFuncLogic.show() + + StudioControls.ButtonGroup { + id: group + } + + StudioControls.AbstractButton { + id: buttonAlignLeft + buttonIcon: StudioTheme.Constants.textAlignLeft + checkable: true + autoExclusive: true + StudioControls.ButtonGroup.group: group + iconColor: __currentColor onClicked: { if (checked) backendValue.setEnumeration("Text", "AlignLeft") } } - ButtonRowButton { - iconSource: "image://icons/alignment-center" + (blueHighlight ? "-h" : "") + StudioControls.AbstractButton { + id: buttonAlignHCenter + buttonIcon: StudioTheme.Constants.textAlignCenter + checkable: true + autoExclusive: true + StudioControls.ButtonGroup.group: group + iconColor: __currentColor onClicked: { if (checked) backendValue.setEnumeration("Text", "AlignHCenter") } } - ButtonRowButton { - iconSource: "image://icons/alignment-right" + (blueHighlight ? "-h" : "") + StudioControls.AbstractButton { + id: buttonAlignRight + buttonIcon: StudioTheme.Constants.textAlignRight + checkable: true + autoExclusive: true + StudioControls.ButtonGroup.group: group + iconColor: __currentColor onClicked: { if (checked) backendValue.setEnumeration("Text", "AlignRight") diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentVerticalButtons.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentVerticalButtons.qml index ac3bd20f358..d74fa5d66ec 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentVerticalButtons.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentVerticalButtons.qml @@ -25,22 +25,12 @@ import QtQuick 2.1 import HelperWidgets 2.0 +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme Row { id: alignmentVerticalButtons - RoundedPanel { - width: 16 - height: parent.height - roundLeft: true - - ExtendedFunctionButton { - x: 2 - anchors.verticalCenter: parent.verticalCenter - backendValue: alignmentVerticalButtons.backendValue - } - } - property bool blueHighlight: false property variant backendValue: backendValues.verticalAlignment; @@ -49,19 +39,20 @@ Row { property bool baseStateFlag: isBaseState; + property color __currentColor: blueHighlight ? StudioTheme.Values.themeInteraction : StudioTheme.Values.themeTextColor + onValueChanged: { - buttonRow.initalChecked = 0 - buttonRow.checkedIndex = 0 + buttonAlignTop.checked = true + buttonAlignVCenter.checked = false + buttonAlignBottom.checked = false + if (value !== undefined) { if (value === "AlignTop") { - buttonRow.initalChecked = 0 - buttonRow.checkedIndex = 0 + buttonAlignTop.checked = true } else if (value === "AlignVCenter") { - buttonRow.initalChecked = 1 - buttonRow.checkedIndex = 1 + buttonAlignVCenter.checked = true } else if (value === "AlignBottom") { - buttonRow.initalChecked = 2 - buttonRow.checkedIndex = 2 + buttonAlignBottom.checked = true } } evaluate() @@ -90,27 +81,54 @@ Row { } } - ButtonRow { - id: buttonRow - exclusive: true + ExtendedFunctionLogic { + id: extFuncLogic + backendValue: alignmentVerticalButtons.backendValue + } - ButtonRowButton { - roundLeftButton: false - iconSource: "image://icons/alignment-top" + (blueHighlight ? "-h" : "") + StudioControls.ButtonRow { + id: buttonRow + actionIndicatorVisible: true + + actionIndicator.icon.color: extFuncLogic.color + actionIndicator.icon.text: extFuncLogic.glyph + actionIndicator.onClicked: extFuncLogic.show() + + StudioControls.ButtonGroup { + id: group + } + + StudioControls.AbstractButton { + id: buttonAlignTop + buttonIcon: StudioTheme.Constants.textAlignTop + checkable: true + autoExclusive: true + StudioControls.ButtonGroup.group: group + iconColor: __currentColor onClicked: { if (checked) backendValue.setEnumeration("Text", "AlignTop") } } - ButtonRowButton { - iconSource: "image://icons/alignment-middle" + (blueHighlight ? "-h" : "") + StudioControls.AbstractButton { + id: buttonAlignVCenter + buttonIcon: StudioTheme.Constants.textAlignMiddle + checkable: true + autoExclusive: true + StudioControls.ButtonGroup.group: group + iconColor: __currentColor onClicked: { if (checked) backendValue.setEnumeration("Text", "AlignVCenter") } } - ButtonRowButton { - iconSource: "image://icons/alignment-bottom" + (blueHighlight ? "-h" : "") + StudioControls.AbstractButton { + id: buttonAlignBottom + buttonIcon: StudioTheme.Constants.textAlignBottom + checkable: true + autoExclusive: true + StudioControls.ButtonGroup.group: group + iconColor: __currentColor onClicked: { if (checked) backendValue.setEnumeration("Text", "AlignBottom") diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AnchorButtons.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AnchorButtons.qml index e7f9859ee49..963f578221a 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AnchorButtons.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AnchorButtons.qml @@ -25,23 +25,32 @@ import QtQuick 2.1 import HelperWidgets 2.0 +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme + +StudioControls.ButtonRow { + id: buttonRow -ButtonRow { enabled: anchorBackend.hasParent opacity: enabled ? 1 : 0.5 - id: buttonRow + actionIndicatorVisible: false - ButtonRowButton { - iconSource: "image://icons/anchor-top" - tooltip: qsTr("Anchor item to the top.") + StudioControls.ButtonGroup { + id: group + } + + StudioControls.AbstractButton { + checkable: true + buttonIcon: StudioTheme.Constants.anchorTop + //tooltip: qsTr("Anchor item to the top.") property bool topAnchored: anchorBackend.topAnchored onTopAnchoredChanged: { checked = topAnchored } - onClicked: { + onClicked: { if (checked) { if (anchorBackend.bottomAnchored) anchorBackend.verticalCentered = false; @@ -52,9 +61,10 @@ ButtonRow { } } - ButtonRowButton { - iconSource: "image://icons/anchor-bottom" - tooltip: qsTr("Anchor item to the bottom.") + StudioControls.AbstractButton { + checkable: true + buttonIcon: StudioTheme.Constants.anchorBottom + //tooltip: qsTr("Anchor item to the bottom.") property bool bottomAnchored: anchorBackend.bottomAnchored onBottomAnchoredChanged: { @@ -73,9 +83,10 @@ ButtonRow { } - ButtonRowButton { - iconSource: "image://icons/anchor-left" - tooltip: qsTr("Anchor item to the left.") + StudioControls.AbstractButton { + checkable: true + buttonIcon: StudioTheme.Constants.anchorLeft + //tooltip: qsTr("Anchor item to the left.") property bool leftAnchored: anchorBackend.leftAnchored onLeftAnchoredChanged: { @@ -93,9 +104,10 @@ ButtonRow { } } - ButtonRowButton { - iconSource: "image://icons/anchor-right" - tooltip: qsTr("Anchor item to the right.") + StudioControls.AbstractButton { + checkable: true + buttonIcon: StudioTheme.Constants.anchorRight + //tooltip: qsTr("Anchor item to the right.") property bool rightAnchored: anchorBackend.rightAnchored onRightAnchoredChanged: { @@ -113,14 +125,15 @@ ButtonRow { } } - ButtonRowButton { + StudioControls.AbstractButton { enabled: false } - ButtonRowButton { - iconSource: "image://icons/anchor-fill" - tooltip: qsTr("Fill parent item.") + StudioControls.AbstractButton { + checkable: true + buttonIcon: StudioTheme.Constants.anchorFill + //tooltip: qsTr("Fill parent item.") property bool isFilled: anchorBackend.isFilled onIsFilledChanged: { @@ -136,13 +149,14 @@ ButtonRow { } } - ButtonRowButton { + StudioControls.AbstractButton { enabled: false } - ButtonRowButton { - iconSource: "image://icons/anchor-vertical" - tooltip: qsTr("Anchor item vertically.") + StudioControls.AbstractButton { + checkable: true + buttonIcon: StudioTheme.Constants.centerVertical + //tooltip: qsTr("Anchor item vertically.") property bool verticalCentered: anchorBackend.verticalCentered; onVerticalCenteredChanged: { @@ -162,9 +176,10 @@ ButtonRow { } } - ButtonRowButton { - iconSource: "image://icons/anchor-horizontal" - tooltip: qsTr("Anchor item horizontally.") + StudioControls.AbstractButton { + checkable: true + buttonIcon: StudioTheme.Constants.centerHorizontal + //tooltip: qsTr("Anchor item horizontally.") property bool horizontalCentered: anchorBackend.horizontalCentered; onHorizontalCenteredChanged: { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/BoolButtonRowButton.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/BoolButtonRowButton.qml index 2b413caaef3..45ff2619288 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/BoolButtonRowButton.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/BoolButtonRowButton.qml @@ -25,33 +25,31 @@ import QtQuick 2.1 import HelperWidgets 2.0 +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme -ButtonRowButton { - id: boolButtonRowButton +StudioControls.Button { + id: button property variant backendValue - property bool isHighlighted: false - property string standardIconSource - property string highlightedIconSource - - leftPadding: 18 - - iconSource: isHighlighted ? highlightedIconSource : standardIconSource + iconColor: isHighlighted ? StudioTheme.Values.themeInteraction : StudioTheme.Values.themeTextColor + actionIndicatorVisible: true + checkable: true QtObject { id: innerObject function evaluate() { if (innerObject.baseStateFlag) { - if (boolButtonRowButton.backendValue !== null + if (button.backendValue !== null && innerObject.isInModel) { isHighlighted = true } else { isHighlighted = false } } else { - if (boolButtonRowButton.backendValue !== null + if (button.backendValue !== null && innerObject.isInSubState) { isHighlighted = true } else { @@ -63,27 +61,30 @@ ButtonRowButton { property bool baseStateFlag: isBaseState onBaseStateFlagChanged: evaluate() - property bool isInModel: boolButtonRowButton.backendValue.isInModel + property bool isInModel: button.backendValue.isInModel onIsInModelChanged: evaluate() - property bool isInSubState: boolButtonRowButton.backendValue.isInSubState + property bool isInSubState: button.backendValue.isInSubState onIsInSubStateChanged: evaluate() - property variant theValue: boolButtonRowButton.backendValue.value + property variant theValue: button.backendValue.value onTheValueChanged: { evaluate() - boolButtonRowButton.checked = innerObject.theValue + button.checked = innerObject.theValue } } onCheckedChanged: { - boolButtonRowButton.backendValue.value = checked + button.backendValue.value = button.checked } - ExtendedFunctionButton { - backendValue: boolButtonRowButton.backendValue - x: 2 - anchors.verticalCenter: parent.verticalCenter + ExtendedFunctionLogic { + id: extFuncLogic + backendValue: button.backendValue } + + actionIndicator.icon.color: extFuncLogic.color + actionIndicator.icon.text: extFuncLogic.glyph + actionIndicator.onClicked: extFuncLogic.show() } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/CheckBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/CheckBox.qml index 8642b9d924c..e599088e426 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/CheckBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/CheckBox.qml @@ -24,10 +24,10 @@ ****************************************************************************/ import QtQuick 2.1 -import StudioControls 1.0 as Controls +import StudioControls 1.0 as StudioControls import QtQuick.Controls.Styles 1.1 -Controls.CheckBox { +StudioControls.CheckBox { id: checkBox property variant backendValue @@ -47,14 +47,14 @@ Controls.CheckBox { id: colorLogic backendValue: checkBox.backendValue onValueFromBackendChanged: { - if (checkBox.checked !== colorLogic.valueFromBackend) - checkBox.checked = colorLogic.valueFromBackend; + if (colorLogic.valueFromBackend !== undefined + && checkBox.checked !== colorLogic.valueFromBackend) + checkBox.checked = colorLogic.valueFromBackend } } onCheckedChanged: { if (backendValue.value !== checkBox.checked) - backendValue.value = checkBox.checked; + backendValue.value = checkBox.checked } - } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorLogic.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorLogic.qml index 97c03ea9215..4426e95cdeb 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorLogic.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorLogic.qml @@ -28,20 +28,21 @@ import QtQuick.Controls 1.1 as Controls import QtQuick.Controls.Styles 1.0 import QtQuickDesignerTheme 1.0 import "Constants.js" as Constants +import StudioTheme 1.0 as StudioTheme QtObject { id: innerObject property variant backendValue - property color textColor: Theme.color(Theme.PanelTextColorLight) + property color textColor: StudioTheme.Values.themeTextColor//Theme.color(Theme.PanelTextColorLight) property variant valueFromBackend: backendValue.value; property bool baseStateFlag: isBaseState; property bool isInModel: backendValue.isInModel; property bool isInSubState: backendValue.isInSubState; property bool highlight: textColor === __changedTextColor - property color __defaultTextColor: Theme.color(Theme.PanelTextColorLight) - readonly property color __changedTextColor: Theme.color(Theme.QmlDesigner_HighlightColor) + property color __defaultTextColor: StudioTheme.Values.themeTextColor//Theme.color(Theme.PanelTextColorLight) + readonly property color __changedTextColor: StudioTheme.Values.themeInteraction//Theme.color(Theme.QmlDesigner_HighlightColor) onBackendValueChanged: { evaluate(); diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComboBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComboBox.qml index 65178606324..62a285a52ba 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComboBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComboBox.qml @@ -24,15 +24,16 @@ ****************************************************************************/ import QtQuick 2.1 -import StudioControls 1.0 as Controls import QtQuick.Controls.Styles 1.1 +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme -Controls.ComboBox { +StudioControls.ComboBox { id: comboBox property variant backendValue - labelColor: colorLogic.textColor + labelColor: edit ? StudioTheme.Values.themeTextColor : colorLogic.textColor property string scope: "Qt" property bool useInteger: false diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml index f6fdf3d2cbc..f64dd622206 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml @@ -54,7 +54,7 @@ Item { // translations are a special case extendedFunctionButton.glyph = StudioTheme.Constants.actionIcon } else { - extendedFunctionButton.glyph = StudioTheme.Constants.closeCross + extendedFunctionButton.glyph = StudioTheme.Constants.actionIconBinding extendedFunctionButton.color = StudioTheme.Values.themeInteraction } } else { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontStyleButtons.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontStyleButtons.qml index 23e5db53e5f..ff06c1e1bdb 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontStyleButtons.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontStyleButtons.qml @@ -25,6 +25,7 @@ import QtQuick 2.1 import HelperWidgets 2.0 +import StudioTheme 1.0 as StudioTheme ButtonRow { @@ -34,25 +35,31 @@ ButtonRow { property variant strikeout: backendValues.font_strikeout BoolButtonRowButton { - standardIconSource: "image://icons/style-bold" - highlightedIconSource: "image://icons/style-bold-h" + buttonIcon: StudioTheme.Constants.fontStyleBold backendValue: bold } + Item { + width: 4 + height: 4 + } BoolButtonRowButton { - standardIconSource: "image://icons/style-italic" - highlightedIconSource: "image://icons/style-italic-h" + buttonIcon: StudioTheme.Constants.fontStyleItalic backendValue: italic } + Item { + width: 4 + height: 4 + } BoolButtonRowButton { - standardIconSource: "image://icons/style-underline" - highlightedIconSource: "image://icons/style-underline-h" + buttonIcon: StudioTheme.Constants.fontStyleUnderline backendValue: underline } - + Item { + width: 4 + height: 4 + } BoolButtonRowButton { - standardIconSource: "image://icons/style-strikeout" - highlightedIconSource: "image://icons/style-strikeout-h" + buttonIcon: StudioTheme.Constants.fontStyleStrikethrough backendValue: strikeout } - } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml index 0dfa558c09e..90e222beadc 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml @@ -24,17 +24,18 @@ ****************************************************************************/ import QtQuick 2.2 -import StudioControls 1.0 as Controls +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme import QtQuick.Controls.Styles 1.0 import QtQuickDesignerTheme 1.0 -Controls.TextField { +StudioControls.TextField { id: lineEdit property variant backendValue property color borderColor: "#222" property color highlightColor: "orange" - color: colorLogic.textColor + color: lineEdit.edit ? StudioTheme.Values.themeTextColor : colorLogic.textColor property bool showTranslateCheckBox: true translationIndicatorVisible: showTranslateCheckBox diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SpinBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SpinBox.qml index eb941166fe2..a8d3d03e06c 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SpinBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SpinBox.qml @@ -26,6 +26,7 @@ import QtQuick 2.1 import QtQuick.Controls.Styles 1.1 import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme Item { id: wrapper @@ -91,7 +92,7 @@ Item { } } - labelColor: colorLogic.textColor + labelColor: edit ? StudioTheme.Values.themeTextColor : colorLogic.textColor onCompressedValueModified: { if (backendValue.value !== realValue) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/AbstractButton.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/AbstractButton.qml index 6746508be26..4dec58d4b6c 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/AbstractButton.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/AbstractButton.qml @@ -31,6 +31,7 @@ T.AbstractButton { id: myButton property alias buttonIcon: buttonIcon.text + property alias iconColor: buttonIcon.color property alias backgroundVisible: buttonBackground.visible implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/Button.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/Button.qml index 40713d3ed13..42d7b3eda83 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/Button.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/Button.qml @@ -31,9 +31,14 @@ ButtonRow { id: myButtonRow property alias buttonIcon: myAbstractButton.buttonIcon + property alias iconColor: myAbstractButton.iconColor property alias checkable: myAbstractButton.checkable + property alias checked: myAbstractButton.checked + + signal onCheckedChanged() AbstractButton { id: myAbstractButton + onCheckedChanged: myButtonRow.onCheckedChanged() } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ButtonRow.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ButtonRow.qml index 614847f3408..059c38ad2c3 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ButtonRow.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ButtonRow.qml @@ -32,9 +32,8 @@ Row { // TODO When using Item as root it won't react to outer layout id: myButtonGroup - property alias actionIcon: actionIndicator.icon + property alias actionIndicator: actionIndicator - //property bool hover: myCheckBox.hovered // TODO property alias actionIndicatorVisible: actionIndicator.visible property real __actionIndicatorWidth: StudioTheme.Values.squareComponentWidth property real __actionIndicatorHeight: StudioTheme.Values.height diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TranslationIndicator.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TranslationIndicator.qml index 7b08347879b..7c4e0c90cec 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TranslationIndicator.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TranslationIndicator.qml @@ -108,8 +108,7 @@ Item { PropertyChanges { target: translationIndicatorBackground - //color: StudioTheme.Values.themeFocusDrag // TODO - color: "red" + color: StudioTheme.Values.themeInteraction // TODO } }, State { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Constants.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Constants.qml index b3b4c58041a..207a154719b 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Constants.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Constants.qml @@ -37,24 +37,30 @@ QtObject { } readonly property string actionIcon: "\u0021" - readonly property string anchorBottom: "\u0022" - readonly property string anchorFill: "\u0023" - readonly property string anchorLeft: "\u0024" - readonly property string anchorRight: "\u0025" - readonly property string anchorTop: "\u0026" - readonly property string centerHorizontal: "\u0027" - readonly property string centerVertical: "\u0028" - readonly property string closeCross: "\u0029" - readonly property string fontStyleBold: "\u002A" - readonly property string fontStyleItalic: "\u002B" - readonly property string fontStyleStrikethrough: "\u002C" - readonly property string fontStyleUnderline: "\u002D" - readonly property string textAlignCenter: "\u002E" - readonly property string textAlignLeft: "\u002F" - readonly property string textAlignRight: "\u0030" - readonly property string tickIcon: "\u0031" - readonly property string upDownIcon: "\u0032" - readonly property string upDownSquare2: "\u0033" + readonly property string actionIconBinding: "\u0022" + readonly property string anchorBaseline: "\u0023" + readonly property string anchorBottom: "\u0024" + readonly property string anchorFill: "\u0025" + readonly property string anchorLeft: "\u0026" + readonly property string anchorRight: "\u0027" + readonly property string anchorTop: "\u0028" + readonly property string centerHorizontal: "\u0029" + readonly property string centerVertical: "\u002A" + readonly property string closeCross: "\u002B" + readonly property string fontStyleBold: "\u002C" + readonly property string fontStyleItalic: "\u002D" + readonly property string fontStyleStrikethrough: "\u002E" + readonly property string fontStyleUnderline: "\u002F" + readonly property string textAlignBottom: "\u0030" + readonly property string textAlignCenter: "\u0031" + readonly property string textAlignLeft: "\u0032" + readonly property string textAlignMiddle: "\u0033" + readonly property string textAlignRight: "\u0034" + readonly property string textAlignTop: "\u0035" + readonly property string tickIcon: "\u0036" + readonly property string triState: "\u0037" + readonly property string upDownIcon: "\u0038" + readonly property string upDownSquare2: "\u0039" readonly property font iconFont: Qt.font({ "family": controlIcons.name, diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf index d2bd44ad4ac760c93f8abf081d30aa11c7924633..9658c0178212b8847a96504a8b339fdc6ac0a77b 100644 GIT binary patch delta 2623 zcmX@3xInX>fsuiMftR6yftew|%`L>Y>uY}u1A|Bl0|SGMf3Ut$SZd-{1_s6m1_p+N z%942n#Z3=GUR3=9k`>50V!|Nk>EGcbtMFfcH1q~}zo z+0Od z7KV!q>I~crybQby>I_^AVGIon>llR?#2EM(I2hCz)W9SM13!cO}D=;WCs4%E91TZkLD(N%oF`5h8 zF^bDE@-eEbv9U9=iODmHnSsRQ7}=Tm7=;;Cm6Y`u?HI*DqGsx9`iyGqZ0yW@%<3Sm zX69z{jAG(qAf=2gva$!Aoka5mgG{BAnAIhDxS0!>g@g_X%P|+!bLbgLaOMkyX#U&I zWX{YEQXs|6&63Z|#wBu4M2LqupG8nif>%PEqd?Tr#^I2IqKasNfX_BA2k|mnMn7Y7 zW=3@rB}PVe?tdG(rPv%!#Hw_w`z&s>5@4WxjBo6(PpOMu;xot>5I z-zFYmE@l=EeR~N;e+MZ^F$XboTZey}49r21ck%ypW^tyy4D1XH!lsI%%7V&*7n$6? zMKI+A2L9D%y2`-7%%J|?nt3y`^yDg5jmg?90xoLi=4wpo>gMKui+F{Ec$w09g@t*G z|7-zqn0ig>hvVds|h(uy5Lv<>EOks-WWc&LM zq?w6{jq`815HHhKkbC}mgGe}=SrKCWpFANcAwD4~A&~!g|EDtFW%@X|iq#?j{$}*K#G|zHmJ+-#mW(or6B)-8~~0Lxbycw zLIsqinHjkL_c7mNIyG5{-8OMQ$osnH>VF&5&2^z{rUrHMzsyYggn0ip@Cq^Q`|Bjc z%hbRt#ON&~CG_vUy1BVJBPf^|6+z5@_ZbyIm{&;XZ!w6;DQHt6TL@Lmv_^;*VgS=AOou=mg>a5M$R&TBgeE(4{9zUQ-_Cq#vJ0nW>?%QVae>Q{ z|9*!xX>%?JU9T=E_xGQmxVRuAlPJFxBYQ--2FDWDjhdP@W?GC+5(?tluD?atyhWEd z$?|fGD~fUR>gC-LV)Yei^OBK~=H&jcEb{}%2| zOpa7hasT(CH|nIgqPV!CIOFzpK`~4wf6u!l%G*@7GZ`|lFmU{LVSd0Y!@$iT&Y;0y z!N9<(sHA3MW~^u=Cc>tQ#Ack#&7u&`^!M)_DHRndCKV|am4Da%y#a9;MWj?z7_0w0 z0YxjbjGDQm_Mg+BXkwNDC3`hhV^vjS)w8N5Dk>(b|K^#iGfRWg@1Lhq+LFvOgn0iv z1tnl+XtcDGM{9uX5dB*CFbfspFo8gGoON<-aS1BJv|3KhRNPMJ@uRn<)GSpl+DcG!7vlbW?>LwmN8yg35J40;SD3?&R{ z3=Emc`FX{Y-}Ab~BLo!~tQZs+%o%hU%oubTj2H|U3>hpL7~JynO5E~`(o+?T^b8cN z6u?^bN=nictQ5?3&2)_n3@sTLG8vK?@)`0N5XM36Sjp!ojxGq&4T^SlekDek$y)q6 z4veCVVvOR95{#0JQhbTYC7Jnop2_)ndc|ewq6n^2W?o8WUOGrrC^0WNBfrQgu{bp+ zGcR>=BL6Ekr~HzV{M^a50$P5;C8-r9jyaj>dA^w`DLJWNEpV}*%=C;BkdOdeC?vlC yB*0UWnVb!?nWv;EGq@zNBz1DLfQAwSYt3PG}1B1W@1_lNh|6qNiu(-r!3=E7B3=9kj z$+?LIHUTE03=E8K7#J9xlFLdI7!;W*85o!i7#J8>(i4jd{{LrSW?&Fl!N9=4k)BhT zc0GE-A_fNL6b1&)h>X<46p7*o9SjT%cNiEL%rY`k>l3*?{GZ9dz$n7Nz@UVfpG@|1A|FUesZF;i=+Sp1G5PO1A|^}VnqQ%977`m1EU241A{_dVs7dqL&4_^ z3_N=n7?^wt@{3Cf73UscVBqIqU|?JT_8cPvLpEQ5Q#`-TR|an87Yqyx3^(4KTLz)! zK#c!(?A6SYAQv+*frJ?tKpL4P|JzNLVN_%mV+fe+z!=SK%&hR=f+31olHt(gWsJ)5 z<_z2nybQby<_ug6sSFJa>llR?_!vYP)WDE`@)t&ZM&rpUOkR^4nf6Scz$84`mYGj^ z0wWuv7h@meB_<`N0;Xk5*O=Zgn=z*`Z((6#31BHRET3V#|&lWZ=E;eQ#Hcn1< zJq4x=kg~rsL{&tYp2`USogpkOEzFc5Eb}Lxi-(Jghl^qIDc0=z4}bqlsj5mbF-fVY z{(Z_TB*e?a1S0<$@^W(Wax$*~Q+GfGM{C7IN6U?WAZCDfdG)(!9Ms~ z0rp`A$n}4gfHZQ2>nSp&gB1Losi+6`+f0!EnbL)2{=DD>1ppTp+n+6L444MR@_eC0|^yS`eSC``ahTX z9@Fm0Q5?33=RjfZqo?q!?$q4^#5SC%O_g6_qn5jWnhS7$L zhwI-3kOvtJxOli24M5C)7Z?pdSXf5pZ!U-_EF%N4C-uJ*bMxdM91g({b*Q@kZGb9f zIwT_uF@R|orb8f(LO4esr3F-L!7Gd)iUE(Aw#3v*r%rBsq zcSnfTSES8LMn+lyRA4YLF^K;6W4_GHJXwibLl0yaa~-dc(BG21iOG>FD(?SY^hRwI zk`fY<5@Kvv7Zk%}{P%)OlAKLtJCniW13U?nTX=3yKFkw4IfKu3av;CgE415e-P&P9|0K+0En}tDwQ5M7&Vc}$8Wl&&r0dZJ38Q2&k7|SO=6UdQt zW5{R7V<=(JV<=%LVMt?O$V|@9bIZ>wnVcl(CW|hsz+lCoz+l8+$)L+%GI_6{f;mX3 zUP(!sf|Y`irLKvtk%6Hl14AZ5GT2;n{Rq?9g&Z+Vhs%NtoE$Ht#3(koNl1sAFEP0! zGe6HWIX`dmJE2#T-w4ad2$iH(lsM*OrsoA^re~Ds6_=&+lw>AngB68|XiTmb5#>RY I$>){<0Mdkz8vp Date: Tue, 11 Jun 2019 11:10:05 +0200 Subject: [PATCH 04/29] AutoTest: Fix updating parent Skip had been added mistakenly to the insignificant results. Do not handle Skip as an insignificant result as it will be correctly handled while updating the result. Fixes: QTCREATORBUG-22545 Change-Id: I3c09416934b1c747dd8160635b5bfaa46c31f5a4 Reviewed-by: David Schulz --- src/plugins/autotest/testresultmodel.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/autotest/testresultmodel.cpp b/src/plugins/autotest/testresultmodel.cpp index f07bc5f0085..a3c6ec28a86 100644 --- a/src/plugins/autotest/testresultmodel.cpp +++ b/src/plugins/autotest/testresultmodel.cpp @@ -116,7 +116,6 @@ void TestResultItem::updateDescription(const QString &description) static bool isSignificant(ResultType type) { switch (type) { - case ResultType::Skip: case ResultType::Benchmark: case ResultType::MessageInfo: case ResultType::MessageInternal: From 50dc5674d30e93ef2ef957eb0d2e620c1c486784 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 6 Jun 2019 17:59:30 +0200 Subject: [PATCH 05/29] ProjectExplorer: Improve "import project" keyboard event handling Pressing return in the path chooser used to activate the "Configure" button, which is not what users intend. Fixes: QTCREATORBUG-17471 Change-Id: I86bc0dd9c976da35026654c7873dc4b63e45593c Reviewed-by: hjk --- src/plugins/projectexplorer/importwidget.cpp | 14 ++++++++++++++ src/plugins/projectexplorer/importwidget.h | 2 ++ .../projectexplorer/targetsettingspanel.cpp | 2 ++ src/plugins/projectexplorer/targetsetuppage.cpp | 5 +++++ src/plugins/projectexplorer/targetsetuppage.h | 1 + 5 files changed, 24 insertions(+) diff --git a/src/plugins/projectexplorer/importwidget.cpp b/src/plugins/projectexplorer/importwidget.cpp index 369e59b60b5..eac2c44c945 100644 --- a/src/plugins/projectexplorer/importwidget.cpp +++ b/src/plugins/projectexplorer/importwidget.cpp @@ -29,6 +29,7 @@ #include #include +#include #include namespace ProjectExplorer { @@ -60,6 +61,14 @@ ImportWidget::ImportWidget(QWidget *parent) : layout->addWidget(importButton); connect(importButton, &QAbstractButton::clicked, this, &ImportWidget::handleImportRequest); + connect(m_pathChooser->lineEdit(), &QLineEdit::returnPressed, this, [this] { + if (m_pathChooser->isValid()) { + handleImportRequest(); + + // The next return should trigger the "Configure" button. + QTimer::singleShot(0, this, QOverload<>::of(&QWidget::setFocus)); + } + }); detailsWidget->setWidget(widget); } @@ -70,6 +79,11 @@ void ImportWidget::setCurrentDirectory(const Utils::FilePath &dir) m_pathChooser->setFileName(dir); } +bool ImportWidget::lineEditHasFocus() const +{ + return m_pathChooser->lineEdit()->hasFocus(); +} + void ImportWidget::handleImportRequest() { Utils::FilePath dir = m_pathChooser->fileName(); diff --git a/src/plugins/projectexplorer/importwidget.h b/src/plugins/projectexplorer/importwidget.h index b9ecdd16acb..8999bc117d0 100644 --- a/src/plugins/projectexplorer/importwidget.h +++ b/src/plugins/projectexplorer/importwidget.h @@ -44,6 +44,8 @@ public: void setCurrentDirectory(const Utils::FilePath &dir); + bool lineEditHasFocus() const; + signals: void importFrom(const Utils::FilePath &dir); diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp index c8e707a549e..91dee3dd6d6 100644 --- a/src/plugins/projectexplorer/targetsettingspanel.cpp +++ b/src/plugins/projectexplorer/targetsettingspanel.cpp @@ -95,6 +95,8 @@ protected: void keyPressEvent(QKeyEvent *event) override { + if (m_targetSetupPage && m_targetSetupPage->importLineEditHasFocus()) + return; if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) { event->accept(); if (m_targetSetupPage) diff --git a/src/plugins/projectexplorer/targetsetuppage.cpp b/src/plugins/projectexplorer/targetsetuppage.cpp index ab7d13a76e2..0a750199fe7 100644 --- a/src/plugins/projectexplorer/targetsetuppage.cpp +++ b/src/plugins/projectexplorer/targetsetuppage.cpp @@ -328,6 +328,11 @@ void TargetSetupPage::setProjectImporter(ProjectImporter *importer) initializePage(); } +bool TargetSetupPage::importLineEditHasFocus() const +{ + return m_importWidget->lineEditHasFocus(); +} + void TargetSetupPage::setNoteText(const QString &text) { m_ui->descriptionLabel->setText(text); diff --git a/src/plugins/projectexplorer/targetsetuppage.h b/src/plugins/projectexplorer/targetsetuppage.h index cbd0305c041..102ffbd57c5 100644 --- a/src/plugins/projectexplorer/targetsetuppage.h +++ b/src/plugins/projectexplorer/targetsetuppage.h @@ -70,6 +70,7 @@ public: void setPreferredKitPredicate(const ProjectExplorer::Kit::Predicate &predicate); void setProjectPath(const QString &dir); void setProjectImporter(ProjectImporter *importer); + bool importLineEditHasFocus() const; /// Sets whether the targetsetupage uses a scrollarea /// to host the widgets from the factories From a093dfc65c519c32a7273b70ef6af7b460363518 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 6 Jun 2019 16:31:58 +0200 Subject: [PATCH 06/29] Wizards: Include namespace in header guards again This was broken in 63c339ffba while trying to fix a different bug. Fixes: QTCREATORBUG-18157 Change-Id: Iec7e14de257195ed9bb20314b8031d3ef59df2ae Reviewed-by: Eike Ziller --- .../creator-only/creator-projects-custom-wizards-json.qdoc | 2 +- share/qtcreator/templates/wizards/classes/cpp/wizard.json | 2 +- .../qtcreator/templates/wizards/projects/cpplibrary/wizard.json | 2 +- .../templates/wizards/projects/qtwidgetsapplication/wizard.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/src/projects/creator-only/creator-projects-custom-wizards-json.qdoc b/doc/src/projects/creator-only/creator-projects-custom-wizards-json.qdoc index 1e1cad47703..80fcdaa832b 100644 --- a/doc/src/projects/creator-only/creator-projects-custom-wizards-json.qdoc +++ b/doc/src/projects/creator-only/creator-projects-custom-wizards-json.qdoc @@ -305,7 +305,7 @@ { "key": "CN", "value": "%{JS: Cpp.className(value('Class'))}" }, { "key": "Base", "value": "%{JS: value('BaseCB') === '' ? value('BaseEdit') : value('BaseCB')}" }, { "key": "isQObject", "value": "%{JS: (value('Base') === 'QObject' || value('Base') === 'QWidget' || value('Base') === 'QMainWindow' || value('Base') === 'QDeclarativeItem' || value('Base') === 'QQuickItem' ) ? 'true' : 'false'}" }, - { "key": "GUARD", "value": "%{JS: Cpp.classToHeaderGuard(value('Class'), Util.preferredSuffix('text/x-c++hdr'))}" }, + { "key": "GUARD", "value": "%{JS: Cpp.classToHeaderGuard(value('Class'), Util.suffix(value('HdrFileName'))}" }, { "key": "SharedDataInit", "value": "%{JS: value('IncludeQSharedData') ? 'data(new %{CN}Data)' : '' }" } ], \endcode diff --git a/share/qtcreator/templates/wizards/classes/cpp/wizard.json b/share/qtcreator/templates/wizards/classes/cpp/wizard.json index dd67d0dd59f..ae466ba7ed1 100644 --- a/share/qtcreator/templates/wizards/classes/cpp/wizard.json +++ b/share/qtcreator/templates/wizards/classes/cpp/wizard.json @@ -17,7 +17,7 @@ { "key": "CN", "value": "%{JS: Cpp.className(value('Class'))}" }, { "key": "Base", "value": "%{JS: value('BaseCB') === '' ? value('BaseEdit') : value('BaseCB')}" }, { "key": "isQObject", "value": "%{JS: [ 'QObject', 'QWidget', 'QMainWindow', 'QDeclarativeItem', 'QQuickItem'].indexOf(value('Base')) >= 0 }" }, - { "key": "GUARD", "value": "%{JS: Cpp.headerGuard(value('HdrFileName'))}" }, + { "key": "GUARD", "value": "%{JS: Cpp.classToHeaderGuard(value('Class'), Util.suffix(value('HdrFileName')))}" }, { "key": "SharedDataInit", "value": "%{JS: (value('IncludeQSharedData')) ? 'data(new %{CN}Data)' : '' }" } ], diff --git a/share/qtcreator/templates/wizards/projects/cpplibrary/wizard.json b/share/qtcreator/templates/wizards/projects/cpplibrary/wizard.json index ac43d6f1a9f..af209105bfd 100644 --- a/share/qtcreator/templates/wizards/projects/cpplibrary/wizard.json +++ b/share/qtcreator/templates/wizards/projects/cpplibrary/wizard.json @@ -30,7 +30,7 @@ { "key": "GlobalHdrFileName", "value": "%{JS: Util.fileName(value('ProjectName') + '_global', Util.preferredSuffix('text/x-c++hdr'))}" }, { "key": "TargetInstallPath", "value": "%{JS: value('IsShared') === 'true' ? '/usr/lib' : (value('IsQtPlugin') && value('PluginTargetPath') ? '$$[QT_INSTALL_PLUGINS]/' + value('PluginTargetPath') : '')}" }, { "key": "CN", "value": "%{JS: Cpp.className(value('Class'))}" }, - { "key": "GUARD", "value": "%{JS: Cpp.headerGuard(value('HdrFileName'))}" }, + { "key": "GUARD", "value": "%{JS: Cpp.classToHeaderGuard(value('Class'), Util.suffix(value('HdrFileName')))}" }, { "key": "GLOBAL_GUARD", "value": "%{JS: Cpp.headerGuard(value('GlobalHdrFileName'))}" } ], diff --git a/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/wizard.json index fa7a4124ef0..9cce84a4130 100644 --- a/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/wizard.json @@ -19,7 +19,7 @@ { "key": "MainFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" }, { "key": "UiHdrFileName", "value": "%{JS: (value('BuildSystem') === 'cmake' ? (Util.path(value('FormFileName')) + '/') : '') + 'ui_' + Util.completeBaseName(value('FormFileName')) + '.h'}" }, { "key": "CN", "value": "%{JS: Cpp.className(value('Class'))}" }, - { "key": "GUARD", "value": "%{JS: Cpp.headerGuard(value('HdrFileName'))}" } + { "key": "GUARD", "value": "%{JS: Cpp.classToHeaderGuard(value('Class'), Util.suffix(value('HdrFileName')))}" } ], "pages": From 25bd5976bad71e30dda89693127bad825c24e3e1 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 11 Jun 2019 17:51:17 +0200 Subject: [PATCH 07/29] CMake build: Make sdktool use parts of Utils Change-Id: I88ab8ab89951bb8966fcc48b7d4ee416015ab8e5 Fixes: QTCREATORBUG-22550 Reviewed-by: Eike Ziller --- src/tools/sdktool/CMakeLists.txt | 35 ++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/src/tools/sdktool/CMakeLists.txt b/src/tools/sdktool/CMakeLists.txt index 3be2fb4f7d6..3997c9763cc 100644 --- a/src/tools/sdktool/CMakeLists.txt +++ b/src/tools/sdktool/CMakeLists.txt @@ -1,8 +1,9 @@ -# TODO: Do not depend on Utils! Include relevant files instead. +get_target_property(UtilsSourcesDir Utils SOURCES_DIR) add_qtc_executable(sdktool DEFINES DATA_PATH=\"${IDE_DATA_PATH}\" - DEPENDS Qt5::Core Utils app_version + DEPENDS Qt5::Core app_version + INCLUDES "${UtilsSourcesDir}/../" SOURCES addabiflavor.cpp addabiflavor.h addcmakeoperation.cpp addcmakeoperation.h @@ -26,3 +27,33 @@ add_qtc_executable(sdktool rmtoolchainoperation.cpp rmtoolchainoperation.h settings.cpp settings.h ) + +extend_qtc_target(sdktool + SOURCES_PREFIX "${UtilsSourcesDir}" + DEFINES QTCREATOR_UTILS_STATIC_LIB + SOURCES + environment.cpp environment.h + fileutils.cpp fileutils.h + hostosinfo.cpp hostosinfo.h + persistentsettings.cpp persistentsettings.h + qtcassert.cpp qtcassert.h + qtcprocess.cpp qtcprocess.h + savefile.cpp savefile.h + stringutils.cpp stringutils.h +) + +extend_qtc_target(sdktool CONDITION APPLE + SOURCES_PREFIX "${UtilsSourcesDir}" + SOURCES + fileutils_mac.mm fileutils_mac.h + DEPENDS + ${FWFoundation} +) + +extend_qtc_target(sdktool CONDITION WIN32 + DEPENDS + user32 iphlpapi ws2_32 shell32 + DEFINES + _UNICODE UNICODE + _CRT_SECURE_NO_WARNINGS _SCL_SECURE_NO_WARNINGS +) From f6db77a0cc56e2ec9a1a66918c52df1b319daa14 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 12 Jun 2019 11:38:27 +0200 Subject: [PATCH 08/29] QmlDesigner: Slightly reduce size of the spin box Change-Id: Ida09ddf17fcdc7000b03c6020334e30cfa7c74ee Reviewed-by: Tim Jenssen --- .../propertyEditorQmlSources/imports/HelperWidgets/SpinBox.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SpinBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SpinBox.qml index a8d3d03e06c..02665fc77a7 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SpinBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SpinBox.qml @@ -41,7 +41,7 @@ Item { property alias backendValue: spinBox.backendValue property alias sliderIndicatorVisible: spinBox.sliderIndicatorVisible - width: 120 + width: 96 implicitHeight: spinBox.height property bool __initialized: false From 0ec78b7b3effaa0fad43c4803374aba89ea09dfc Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 12 Jun 2019 11:36:51 +0200 Subject: [PATCH 09/29] QmlDesigner: Do not sync z value on root item Setting the z value on the root item triggers side effects. Task-number: QDS-800 Change-Id: I52021b7e3e59b67088a69f2a89f0cdffa90fffb8 Reviewed-by: Tim Jenssen --- .../qmldesigner/components/formeditor/formeditoritem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp index f26e0354425..9f6d3e9cd81 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp @@ -109,7 +109,7 @@ void FormEditorItem::updateGeometry() m_boundingRect = m_paintedBoundingRect.united(m_selectionBoundingRect); setTransform(qmlItemNode().instanceTransformWithContentTransform()); //the property for zValue is called z in QGraphicsObject - if (qmlItemNode().instanceValue("z").isValid()) + if (qmlItemNode().instanceValue("z").isValid() && !qmlItemNode().isRootModelNode()) setZValue(qmlItemNode().instanceValue("z").toDouble()); } From b94c725f0f3e3ec63424c8a9feb09837b6e5285e Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 12 Jun 2019 11:37:42 +0200 Subject: [PATCH 10/29] QmlDesigner: Reserve less space for label We currently waste too much space for long label. Eliding works fine for long property names. Change-Id: I1fe2836e8c06cff93e2a48c6290265ab300e5321 Reviewed-by: Tim Jenssen --- .../propertyEditorQmlSources/imports/HelperWidgets/Label.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Label.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Label.qml index 23901e8dc92..e4129c6dcff 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Label.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Label.qml @@ -37,7 +37,7 @@ Controls.Label { // workaround because PictureSpecifics.qml still use this property alias toolTip: toolTipArea.tooltip - width: Math.max(Math.min(240, parent.width - 220), 80) + width: Math.max(Math.min(240, parent.width - 280), 50) color: Theme.color(Theme.PanelTextColorLight) elide: Text.ElideRight From 2391ef6088c14e41a6b6183fab43ca365eb5be42 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 4 Jun 2019 16:34:00 +0200 Subject: [PATCH 11/29] Output panes: Improve the way to signal that filtering is active At the moment, background and foreground colors of an output pane are changed (via the widget's palette) when filtering is active, in order to make it clear to the user that the output is being tampered with. There are several problems there: - The chosen background color is quite garish. - More importantly, the palette change has no effect in the compile and app output panes, because their output is explicitly formatted and thus not affected by the general text color change. As a result, the output may no longer be readable. We fix this by choosing a less intrusive approach that simply darkens (or lightens) the pane's background color a bit when filtering is active. This is still clearly visible to the user. Change-Id: I41e053b4b218be57fe7655e314d4ebf93f59f505 Reviewed-by: Eike Ziller --- .../coreplugin/messageoutputwindow.cpp | 2 - src/plugins/coreplugin/outputwindow.cpp | 37 +++++++------------ src/plugins/coreplugin/outputwindow.h | 2 - src/plugins/projectexplorer/appoutputpane.cpp | 5 --- .../projectexplorer/compileoutputwindow.cpp | 5 --- 5 files changed, 13 insertions(+), 38 deletions(-) diff --git a/src/plugins/coreplugin/messageoutputwindow.cpp b/src/plugins/coreplugin/messageoutputwindow.cpp index 60092829537..7aabaefbbc9 100644 --- a/src/plugins/coreplugin/messageoutputwindow.cpp +++ b/src/plugins/coreplugin/messageoutputwindow.cpp @@ -53,8 +53,6 @@ MessageOutputWindow::MessageOutputWindow() QColor activeHighlightedText = p.color(QPalette::Active, QPalette::HighlightedText); p.setColor(QPalette::HighlightedText, activeHighlightedText); m_widget->setPalette(p); - m_widget->setHighlightBgColor(p.color(QPalette::Highlight)); - m_widget->setHighlightTextColor(p.color(QPalette::HighlightedText)); connect(this, &IOutputPane::zoomIn, m_widget, &Core::OutputWindow::zoomIn); connect(this, &IOutputPane::zoomOut, m_widget, &Core::OutputWindow::zoomOut); diff --git a/src/plugins/coreplugin/outputwindow.cpp b/src/plugins/coreplugin/outputwindow.cpp index 0ed7542ee16..9e204821137 100644 --- a/src/plugins/coreplugin/outputwindow.cpp +++ b/src/plugins/coreplugin/outputwindow.cpp @@ -59,8 +59,6 @@ public: IContext *outputWindowContext = nullptr; Utils::OutputFormatter *formatter = nullptr; - QColor highlightBgColor; - QColor highlightTextColor; QString settingsKey; bool enforceNewline = false; @@ -273,16 +271,6 @@ void OutputWindow::setWheelZoomEnabled(bool enabled) d->zoomEnabled = enabled; } -void OutputWindow::setHighlightBgColor(const QColor &bgColor) -{ - d->highlightBgColor = bgColor; -} - -void OutputWindow::setHighlightTextColor(const QColor &textColor) -{ - d->highlightTextColor = textColor; -} - void OutputWindow::updateFilterProperties(const QString &filterText, Qt::CaseSensitivity caseSensitivity, bool isRegexp) { @@ -297,21 +285,22 @@ void OutputWindow::updateFilterProperties(const QString &filterText, d->filterText = filterText; // Update textedit's background color - if (filterText.isEmpty()) { + if (filterText.isEmpty() && !filterTextWasEmpty) { setPalette(d->originalPalette); setReadOnly(d->originalReadOnly); - } else { - if (filterTextWasEmpty) { - d->originalReadOnly = isReadOnly(); - d->originalPalette = palette(); - } - QPalette pal; - pal.setColor(QPalette::Active, QPalette::Base, d->highlightBgColor); - pal.setColor(QPalette::Inactive, QPalette::Base, d->highlightBgColor.darker(120)); - pal.setColor(QPalette::Active, QPalette::Text, d->highlightTextColor); - pal.setColor(QPalette::Inactive, QPalette::Text, d->highlightTextColor.darker(120)); - setPalette(pal); + } + if (!filterText.isEmpty() && filterTextWasEmpty) { + d->originalReadOnly = isReadOnly(); setReadOnly(true); + const auto newBgColor = [this] { + const QColor currentColor = palette().color(QPalette::Base); + const int factor = 120; + return currentColor.value() < 128 ? currentColor.lighter(factor) + : currentColor.darker(factor); + }; + QPalette p = palette(); + p.setColor(QPalette::Base, newBgColor()); + setPalette(p); } } d->filterMode = flags; diff --git a/src/plugins/coreplugin/outputwindow.h b/src/plugins/coreplugin/outputwindow.h index f89ad521f7b..88692d5ab74 100644 --- a/src/plugins/coreplugin/outputwindow.h +++ b/src/plugins/coreplugin/outputwindow.h @@ -76,8 +76,6 @@ public: float fontZoom() const; void setFontZoom(float zoom); void setWheelZoomEnabled(bool enabled); - void setHighlightBgColor(const QColor &bgColor); - void setHighlightTextColor(const QColor &textColor); void updateFilterProperties(const QString &filterText, Qt::CaseSensitivity caseSensitivity, bool regexp); diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index 948780aabcb..7631f26cac6 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -426,7 +426,6 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc) } // Create new static int counter = 0; - const TextEditor::FontSettings &fs = TextEditor::TextEditorSettings::fontSettings(); Core::Id contextId = Core::Id(C_APP_OUTPUT).withSuffix(counter++); Core::Context context(contextId); Core::OutputWindow *ow = new Core::OutputWindow(context, SETTINGS_KEY, m_tabWidget); @@ -434,10 +433,6 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc) ow->setWindowIcon(Icons::WINDOW.icon()); ow->setWordWrapEnabled(m_settings.wrapOutput); ow->setMaxCharCount(m_settings.maxCharCount); - ow->setHighlightBgColor(fs.toTextCharFormat(TextEditor::C_SEARCH_RESULT) - .background().color()); - ow->setHighlightTextColor(fs.toTextCharFormat(TextEditor::C_SEARCH_RESULT) - .foreground().color()); auto updateFontSettings = [ow] { ow->setBaseFont(TextEditor::TextEditorSettings::fontSettings().font()); diff --git a/src/plugins/projectexplorer/compileoutputwindow.cpp b/src/plugins/projectexplorer/compileoutputwindow.cpp index 3d19bd9514a..91cc2fb22cc 100644 --- a/src/plugins/projectexplorer/compileoutputwindow.cpp +++ b/src/plugins/projectexplorer/compileoutputwindow.cpp @@ -172,11 +172,6 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) : updateFontSettings(); updateZoomEnabled(); - const TextEditor::FontSettings &fs = TextEditor::TextEditorSettings::fontSettings(); - m_outputWindow->setHighlightBgColor(fs.toTextCharFormat(TextEditor::C_SEARCH_RESULT) - .background().color()); - m_outputWindow->setHighlightTextColor(fs.toTextCharFormat(TextEditor::C_SEARCH_RESULT) - .foreground().color()); setupFilterUi("CompileOutputPane.Filter"); setFilteringEnabled(true); From 07f50c8dec4a20c9ffefb3b7969f77fca837ee83 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 12 Jun 2019 12:23:48 +0200 Subject: [PATCH 12/29] Debugger: Use QElapsedTimer instead of QTime::elapsed() Deprecation looming. Change-Id: Ibafbac6fbe48d74ba7d88c22400d581e49e4e45d Reviewed-by: David Schulz Reviewed-by: Edward Welbourne --- src/plugins/debugger/cdb/cdbengine.cpp | 11 ++++------- src/plugins/debugger/cdb/cdbengine.h | 7 +++---- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 6c6e5de61a2..4a3839159ec 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -324,12 +324,9 @@ static QStringList mergeEnvironment(QStringList runConfigEnvironment, return runConfigEnvironment; } -int CdbEngine::elapsedLogTime() const +int CdbEngine::elapsedLogTime() { - const int elapsed = m_logTime.elapsed(); - const int delta = elapsed - m_elapsedLogTime; - m_elapsedLogTime = elapsed; - return delta; + return m_logTimer.restart(); } void CdbEngine::createFullBacktrace() @@ -352,8 +349,8 @@ void CdbEngine::setupEngine() qDebug(">setupEngine"); init(); - if (!m_logTime.elapsed()) - m_logTime.start(); + if (!m_logTimer.elapsed()) + m_logTimer.start(); // Console: Launch the stub with the suspended application and attach to it // CDB in theory has a command line option '-2' that launches a diff --git a/src/plugins/debugger/cdb/cdbengine.h b/src/plugins/debugger/cdb/cdbengine.h index 16b71b954b4..bd83105df7b 100644 --- a/src/plugins/debugger/cdb/cdbengine.h +++ b/src/plugins/debugger/cdb/cdbengine.h @@ -32,7 +32,7 @@ #include -#include +#include namespace Debugger { namespace Internal { @@ -195,7 +195,7 @@ private: NormalizedSourceFileName sourceMapNormalizeFileNameFromDebugger(const QString &f); void doUpdateLocals(const UpdateParameters ¶ms) override; void updateAll() override; - int elapsedLogTime() const; + int elapsedLogTime(); unsigned parseStackTrace(const GdbMi &data, bool sourceStepInto); void mergeStartParametersSourcePathMap(); @@ -223,8 +223,7 @@ private: wow64Stack32Bit, wow64Stack64Bit } m_wow64State = wow64Uninitialized; - QTime m_logTime; - mutable int m_elapsedLogTime = 0; + QElapsedTimer m_logTimer; QString m_extensionMessageBuffer; bool m_sourceStepInto = false; int m_watchPointX = 0; From ee68a4e7b4e47897619517e629ba4b1ed1c213d6 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 12 Jun 2019 12:24:59 +0200 Subject: [PATCH 13/29] Debugger: Remove unused declarations Change-Id: Ib5d1b0346a52c465436306a9223e2aa554ae0801 Reviewed-by: David Schulz --- src/plugins/debugger/cdb/cdbengine.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/plugins/debugger/cdb/cdbengine.h b/src/plugins/debugger/cdb/cdbengine.h index bd83105df7b..fd0e35ba8a3 100644 --- a/src/plugins/debugger/cdb/cdbengine.h +++ b/src/plugins/debugger/cdb/cdbengine.h @@ -38,8 +38,6 @@ namespace Debugger { namespace Internal { class CdbCommand; -struct MemoryViewCookie; -class StringInputStream; class CdbEngine : public CppDebuggerEngine { From 5ac71e485ac2b8a480454e5111fc4219ec7efc45 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 12 Jun 2019 09:45:13 +0200 Subject: [PATCH 14/29] ModelingLib: Use QElapsedTimer instead of QTime ... because of recent deprecation of QTime::elapsed. Change-Id: I5bb8cd2a613a0258669055471008c5d6b4db1099 Reviewed-by: Edward Welbourne Reviewed-by: hjk --- .../modelinglib/qmt/model_widgets_ui/modeltreeview.cpp | 7 +++---- src/libs/modelinglib/qmt/model_widgets_ui/modeltreeview.h | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/libs/modelinglib/qmt/model_widgets_ui/modeltreeview.cpp b/src/libs/modelinglib/qmt/model_widgets_ui/modeltreeview.cpp index 37e74adeac8..3bcc0727fb5 100644 --- a/src/libs/modelinglib/qmt/model_widgets_ui/modeltreeview.cpp +++ b/src/libs/modelinglib/qmt/model_widgets_ui/modeltreeview.cpp @@ -173,14 +173,13 @@ void ModelTreeView::dragMoveEvent(QDragMoveEvent *event) if (dynamic_cast(modelElement)) accept = true; if (m_autoDelayIndex == dropIndex) { - if (m_autoDelayStartTime.elapsed() > 1000) { + if (m_autoDelayStartTimer.elapsed() > 1000) { setExpanded(dropIndex, !isExpanded(dropIndex)); - m_autoDelayStartTime.start(); + m_autoDelayStartTimer.start(); } } else { m_autoDelayIndex = dropIndex; - m_autoDelayStartTime = QTime::currentTime(); - m_autoDelayStartTime.start(); + m_autoDelayStartTimer.start(); } } event->setAccepted(accept); diff --git a/src/libs/modelinglib/qmt/model_widgets_ui/modeltreeview.h b/src/libs/modelinglib/qmt/model_widgets_ui/modeltreeview.h index 724097a3656..565d3671c2a 100644 --- a/src/libs/modelinglib/qmt/model_widgets_ui/modeltreeview.h +++ b/src/libs/modelinglib/qmt/model_widgets_ui/modeltreeview.h @@ -25,11 +25,11 @@ #pragma once -#include #include "qmt/infrastructure/qmt_global.h" #include "qmt/model_ui/modeltreeviewinterface.h" -#include +#include +#include namespace qmt { @@ -70,7 +70,7 @@ private: SortedTreeModel *m_sortedTreeModel = nullptr; IElementTasks *m_elementTasks = nullptr; QModelIndex m_autoDelayIndex; - QTime m_autoDelayStartTime; + QElapsedTimer m_autoDelayStartTimer; }; } // namespace qmt From 36135aa26174c2ebf6dec213a469e671e67b2cfb Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Wed, 12 Jun 2019 14:49:47 +0200 Subject: [PATCH 15/29] CMake: Small clean-up of CMake Wizards * Updated CMake minimum version to 3.5 (Ubuntu LTS 16.04) * Lowercase commands * Used the target name instead of ${PROJECT_NAME}, which nobody uses in practice * No string quotes around the source filenames, which do not contain spaces Change-Id: Ide9b3eb85535213798c6c35e08624cae080ebd9d Reviewed-by: Tobias Hunger --- .../templates/wizards/autotest/files/tst.txt | 72 +++++++++++-------- .../projects/consoleapp/CMakeLists.txt | 15 ++-- .../projects/cpplibrary/CMakeLists.txt | 16 ++--- .../wizards/projects/plainc/CMakeLists.txt | 7 +- .../wizards/projects/plaincpp/CMakeLists.txt | 10 ++- .../qtquickapplication/CMakeLists.txt | 15 ++-- .../qtwidgetsapplication/CMakeLists.txt | 16 +++-- 7 files changed, 89 insertions(+), 62 deletions(-) diff --git a/share/qtcreator/templates/wizards/autotest/files/tst.txt b/share/qtcreator/templates/wizards/autotest/files/tst.txt index 2d3826d00b2..bf5e75ff16e 100644 --- a/share/qtcreator/templates/wizards/autotest/files/tst.txt +++ b/share/qtcreator/templates/wizards/autotest/files/tst.txt @@ -1,7 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.1) +cmake_minimum_required(VERSION 3.5) -PROJECT(%{TestCaseName} - LANGUAGES CXX) +project(%{TestCaseName} LANGUAGES CXX) @if "%{TestFrameWork}" == "QtTest" @@ -10,38 +9,46 @@ find_package(Qt5Test REQUIRED) find_package(Qt5Gui REQUIRED) @endif -SET(CMAKE_AUTOMOC ON) -SET(CMAKE_INCLUDE_CURRENT_DIR ON) -SET(CMAKE_CXX_STANDARD 11) -SET(CMAKE_CXX_STANDARD_REQUIRED ON) -ENABLE_TESTING() +set(CMAKE_INCLUDE_CURRENT_DIR ON) -add_executable(${PROJECT_NAME} %{TestCaseFileWithCppSuffix}) -add_test(${PROJECT_NAME} COMMAND ${PROJECT_NAME}) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +enable_testing() + +add_executable(%{TestCaseName} %{TestCaseFileWithCppSuffix}) +add_test(%{TestCaseName} COMMAND %{TestCaseName}) @if "%{RequireGUI}" == "true" -target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Gui Qt5::Test) +target_link_libraries(%{TestCaseName} PRIVATE Qt5::Gui Qt5::Test) @else -target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Test) +target_link_libraries(%{TestCaseName} PRIVATE Qt5::Test) @endif @endif @if "%{TestFrameWork}" == "QtQuickTest" find_package(Qt5QuickTest REQUIRED) -SET(CMAKE_AUTOMOC ON) -SET(CMAKE_INCLUDE_CURRENT_DIR ON) -SET(CMAKE_CXX_STANDARD 11) -SET(CMAKE_CXX_STANDARD_REQUIRED ON) -ENABLE_TESTING() +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +enable_testing() # no need to copy around qml test files for shadow builds - just set the respective define add_definitions(-DQUICK_TEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}") -add_executable(${PROJECT_NAME} %{MainCppName}) -add_test(${PROJECT_NAME} COMMAND ${PROJECT_NAME}) +add_executable(%{TestCaseName} %{MainCppName}) +add_test(%{TestCaseName} COMMAND %{TestCaseName}) -target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::QuickTest) +target_link_libraries(%{TestCaseName} PRIVATE Qt5::QuickTest) @endif @if "%{TestFrameWork}" == "GTest" @@ -53,14 +60,14 @@ add_definitions(-DGTEST_LANGUAGE_CXX11) find_package(Threads REQUIRED) if ($ENV{GOOGLETEST_DIR}) - SET(GOOGLETEST_DIR $ENV{GOOGLETEST_DIR}) + set(GOOGLETEST_DIR $ENV{GOOGLETEST_DIR}) else () message(WARNING "Using googletest src dir specified at Qt Creator wizard") - SET(GOOGLETEST_DIR "%{GTestRepository}") + set(GOOGLETEST_DIR "%{GTestRepository}") endif () if (EXISTS ${GOOGLETEST_DIR}) - SET(GTestSrc ${GOOGLETEST_DIR}/googletest) - SET(GMockSrc ${GOOGLETEST_DIR}/googlemock) + set(GTestSrc ${GOOGLETEST_DIR}/googletest) + set(GMockSrc ${GOOGLETEST_DIR}/googlemock) else () message( FATAL_ERROR "No googletest src dir found - set GOOGLETEST_DIR to enable!") endif () @@ -68,19 +75,22 @@ endif () include_directories(${GTestSrc} ${GTestSrc}/include ${GMockSrc} ${GMockSrc}/include) -add_executable(${PROJECT_NAME} %{MainCppName} %{TestCaseFileWithHeaderSuffix} +add_executable(%{TestCaseName} %{MainCppName} %{TestCaseFileWithHeaderSuffix} ${GTestSrc}/src/gtest-all.cc ${GMockSrc}/src/gmock-all.cc) -add_test(${PROJECT_NAME} COMMAND ${PROJECT_NAME}) -target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads) +add_test(%{TestCaseName} COMMAND %{TestCaseName}) +target_link_libraries(%{TestCaseName} PRIVATE Threads::Threads) @endif @if "%{TestFrameWork}" == "BoostTest" -SET(CMAKE_INCLUDE_CURRENT_DIR ON) -ENABLE_TESTING() +set(CMAKE_INCLUDE_CURRENT_DIR ON) -add_executable(${PROJECT_NAME} %{MainCppName}) -add_test(${PROJECT_NAME} COMMAND ${PROJECT_NAME}) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +enable_testing() + +add_executable(%{TestCaseName} %{MainCppName}) +add_test(%{TestCaseName} COMMAND %{TestCaseName}) if (DEFINED ENV{BOOST_INCLUDE_DIR}) set(BOOST_INCLUDE_DIR $ENV{BOOST_INCLUDE_DIR}) diff --git a/share/qtcreator/templates/wizards/projects/consoleapp/CMakeLists.txt b/share/qtcreator/templates/wizards/projects/consoleapp/CMakeLists.txt index 4beef640b7c..ce63061d750 100644 --- a/share/qtcreator/templates/wizards/projects/consoleapp/CMakeLists.txt +++ b/share/qtcreator/templates/wizards/projects/consoleapp/CMakeLists.txt @@ -1,12 +1,17 @@ -cmake_minimum_required(VERSION 3.0.0) +cmake_minimum_required(VERSION 3.5) -project(%{ProjectName} VERSION 0.1 LANGUAGES CXX) +project(%{ProjectName} LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(Qt5Core) -add_executable(${PROJECT_NAME} "%{CppFileName}") - -target_link_libraries(${PROJECT_NAME} Qt5::Core) +add_executable(%{ProjectName} %{CppFileName}) +target_link_libraries(%{ProjectName} Qt5::Core) diff --git a/share/qtcreator/templates/wizards/projects/cpplibrary/CMakeLists.txt b/share/qtcreator/templates/wizards/projects/cpplibrary/CMakeLists.txt index 29d83968520..243280b6577 100644 --- a/share/qtcreator/templates/wizards/projects/cpplibrary/CMakeLists.txt +++ b/share/qtcreator/templates/wizards/projects/cpplibrary/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.5) project(%{ProjectName} LANGUAGES CXX) @@ -15,21 +15,21 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(Qt5 COMPONENTS %{QtModuleUpperCase} REQUIRED) @endif -add_library(${PROJECT_NAME} %{JS: %{IsStatic} ? 'STATIC' : 'SHARED'} +add_library(%{ProjectName} %{JS: %{IsStatic} ? 'STATIC' : 'SHARED'} @if '%{Type}' === 'shared' - "%{GlobalHdrFileName}" + %{GlobalHdrFileName} @endif - "%{SrcFileName}" - "%{HdrFileName}" + %{SrcFileName} + %{HdrFileName} @if %{IsQtPlugin} - "%{PluginJsonFile}" + %{PluginJsonFile} @endif ) @if '%{QtModule}' != 'none' -target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::%{QtModuleUpperCase}) +target_link_libraries(%{ProjectName} PRIVATE Qt5::%{QtModuleUpperCase}) @endif @if '%{IsShared}' -target_compile_definitions(${PROJECT_NAME} PRIVATE %{LibraryDefine}) +target_compile_definitions(%{ProjectName} PRIVATE %{LibraryDefine}) @endif diff --git a/share/qtcreator/templates/wizards/projects/plainc/CMakeLists.txt b/share/qtcreator/templates/wizards/projects/plainc/CMakeLists.txt index f4783c4195d..5af2f09fb67 100644 --- a/share/qtcreator/templates/wizards/projects/plainc/CMakeLists.txt +++ b/share/qtcreator/templates/wizards/projects/plainc/CMakeLists.txt @@ -1,4 +1,5 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.5) -project(%{ProjectName}) -add_executable(${PROJECT_NAME} "%{CFileName}") +project(%{ProjectName} LANGUAGES C) + +add_executable(%{ProjectName} %{CFileName}) diff --git a/share/qtcreator/templates/wizards/projects/plaincpp/CMakeLists.txt b/share/qtcreator/templates/wizards/projects/plaincpp/CMakeLists.txt index 6393118931f..cdea69420e2 100644 --- a/share/qtcreator/templates/wizards/projects/plaincpp/CMakeLists.txt +++ b/share/qtcreator/templates/wizards/projects/plaincpp/CMakeLists.txt @@ -1,4 +1,8 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.5) -project(%{ProjectName}) -add_executable(${PROJECT_NAME} "%{CppFileName}") +project(%{ProjectName} LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +add_executable(%{ProjectName} %{CppFileName}) diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt b/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt index 0b7b8321556..165a32be3de 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt @@ -1,23 +1,28 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.5) project(%{ProjectName} LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) + set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(Qt5 COMPONENTS Core Quick REQUIRED) if(ANDROID) - add_library(${PROJECT_NAME} SHARED "%{MainCppFileName}" "qml.qrc") + add_library(%{ProjectName} SHARED %{MainCppFileName} qml.qrc) else() - add_executable(${PROJECT_NAME} "%{MainCppFileName}" "qml.qrc") + add_executable(%{ProjectName} %{MainCppFileName} qml.qrc) endif() -target_compile_definitions(${PROJECT_NAME} PRIVATE $<$,$>:QT_QML_DEBUG>) -target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Quick) +target_compile_definitions(%{ProjectName} + PRIVATE $<$,$>:QT_QML_DEBUG>) +target_link_libraries(%{ProjectName} + PRIVATE Qt5::Core Qt5::Quick) # QtCreator supports the following variables for Android, which are identical to qmake Android variables. # Check http://doc.qt.io/qt-5/deployment-android.html for more information. diff --git a/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/CMakeLists.txt b/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/CMakeLists.txt index 75a2beb233d..5fd51e90149 100644 --- a/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/CMakeLists.txt +++ b/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/CMakeLists.txt @@ -1,23 +1,25 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.5) project(%{ProjectName} LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) + set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(Qt5 COMPONENTS Widgets REQUIRED) -add_executable(${PROJECT_NAME} - "%{MainFileName}" - "%{SrcFileName}" - "%{HdrFileName}" +add_executable(%{ProjectName} + %{MainFileName} + %{SrcFileName} + %{HdrFileName} @if %{GenerateForm} - "%{FormFileName}" + %{FormFileName} @endif ) -target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Widgets) +target_link_libraries(%{ProjectName} PRIVATE Qt5::Widgets) From 798879c797f0e1ea42e78f4f1f56532e691f20c1 Mon Sep 17 00:00:00 2001 From: Uladzislau Paulovich Date: Sun, 9 Jun 2019 00:32:44 +0300 Subject: [PATCH 16/29] qml | Fix pragma reformatting After this change reformatter test (tests/auto/qml/reformatter/tst_reformatter) starts to work correctly for singleton example (qmlsingleton.qml) NOTE: Just cherry-picking change from master branch. Change-Id: Ia0561aa8b920fc5c62a8dea93341721f37b68dd8 Reviewed-by: Thomas Hartmann (cherry picked from commit 749eaaad81145072181a42aaf007ada71816cf3b) Reviewed-by: Tim Jenssen --- src/libs/qmljs/qmljsreformatter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/qmljs/qmljsreformatter.cpp b/src/libs/qmljs/qmljsreformatter.cpp index 5a5254fe264..b2bb503d22e 100644 --- a/src/libs/qmljs/qmljsreformatter.cpp +++ b/src/libs/qmljs/qmljsreformatter.cpp @@ -537,6 +537,8 @@ protected: bool visit(UiPragma *ast) override { out("pragma ", ast->pragmaToken); + out(ast->name.toString()); + newLine(); return false; } From 2831f601fac686384f68debb463b93de467ec2c7 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 11 Jun 2019 14:54:00 +0200 Subject: [PATCH 17/29] QmlDesigner: Use OpenGL 4.1 surface for puppet Change-Id: I520adbb54fc264e738ca5eb630f5cc7bc80ee4bd Reviewed-by: Tim Jenssen --- .../qml2puppet/instances/qt5nodeinstanceserver.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.cpp index 8c0358c3bca..2a9118625c7 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.cpp @@ -25,6 +25,8 @@ #include "qt5nodeinstanceserver.h" +#include + #include #include @@ -58,6 +60,12 @@ void Qt5NodeInstanceServer::initializeView() Q_ASSERT(!quickView()); m_quickView = new QQuickView; + + QSurfaceFormat surfaceFormat = m_quickView->requestedFormat(); + surfaceFormat.setVersion(4, 1); + surfaceFormat.setProfile(QSurfaceFormat::CoreProfile); + m_quickView->setFormat(surfaceFormat); + DesignerSupport::createOpenGLContext(m_quickView.data()); if (qEnvironmentVariableIsSet("QML_FILE_SELECTORS")) { From bcf32dcc935ab863baa89acff9f5d260102638a1 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 12 Jun 2019 10:53:21 +0200 Subject: [PATCH 18/29] StudioWelcome: Final fixes for splash screen Change-Id: If643c5ba61c2aec84c5e25b08627cb451dcd623f Reviewed-by: Tim Jenssen --- src/plugins/studiowelcome/qml/splashscreen/NoShowCheckbox.qml | 1 - src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/studiowelcome/qml/splashscreen/NoShowCheckbox.qml b/src/plugins/studiowelcome/qml/splashscreen/NoShowCheckbox.qml index d2f7454f093..2b714a47846 100644 --- a/src/plugins/studiowelcome/qml/splashscreen/NoShowCheckbox.qml +++ b/src/plugins/studiowelcome/qml/splashscreen/NoShowCheckbox.qml @@ -26,7 +26,6 @@ import QtQuick 2.7 import QtQuick.Timeline 1.0 import QtQuick.Controls 2.12 -import welcome 1.0 CheckBox { id: do_not_show_checkBox diff --git a/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml b/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml index fa90cd8a652..c00bde1ce89 100644 --- a/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml +++ b/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml @@ -27,6 +27,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.3 import StudioFonts 1.0 import QtQuick.Layouts 1.0 +import projectmodel 1.0 Image { id: welcome_splash @@ -243,7 +244,7 @@ Image { color: "#ffffff" text: qsTr("Community Edition") font.pixelSize: 13 - font.family: Constants.titilliumWeb_light + font.family: StudioFonts.titilliumWeb_light visible: projectModel.communityVersion ProjectModel { id: projectModel From 05c5a8bfa0878b4d9d2af50d1d47441c60289ee3 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 12 Jun 2019 16:10:39 +0200 Subject: [PATCH 19/29] StudioWelcome: Fix warning Change-Id: I9a023629ff951acb9d53482795c928a2202650f9 Reviewed-by: Thomas Hartmann --- src/plugins/studiowelcome/qml/welcomepage/main.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/studiowelcome/qml/welcomepage/main.qml b/src/plugins/studiowelcome/qml/welcomepage/main.qml index 288321c2d98..759ac459235 100644 --- a/src/plugins/studiowelcome/qml/welcomepage/main.qml +++ b/src/plugins/studiowelcome/qml/welcomepage/main.qml @@ -196,7 +196,7 @@ Item { anchors.rightMargin: 23 font.weight: Font.Light font.pixelSize: 14 - font.family: Constants.titilliumWeb_regular + font.family: StudioFonts.titilliumWeb_regular renderType: Text.NativeRendering visible: projectModel.communityVersion } From aa30828f40b1443c9fcaa0114b3e9d53c62a93c7 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 12 Jun 2019 11:38:05 +0200 Subject: [PATCH 20/29] QmlDesigner: Disable horizontal scrollbar for property editor Change-Id: Id6b9dc66ca86f775c7d8fd8a5c847becb5cf96cb Reviewed-by: Tim Jenssen --- .../qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml index 0f1e828431f..a74fc94f1e5 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml @@ -40,6 +40,7 @@ Rectangle { ScrollView { anchors.fill: parent + horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff Column { y: -1 From da3f9eb5bf91887e3928ec4ba9cb91aa0e9e2bf9 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 12 Jun 2019 16:09:23 +0200 Subject: [PATCH 21/29] QmlDesigner: Fix property editor template for colors The color editor requires its own section. Therefore we mark the color type with 'separateSection'. For this to work we have to order all properties. The properties that require their own section do come first. The QML code generation became a bit more complicated, but having proper default sheets for colors should be worth it. Task-number: QDS-742 Change-Id: I1eee71aa05c66af4aaf53e0e8c5a3514a9ca6d92 Reviewed-by: Tim Jenssen --- .../ColorEditorTemplate.template | 3 - .../PropertyTemplates/TemplateTypes.qml | 3 +- .../propertyeditorqmlbackend.cpp | 64 +++++++++++++++++-- 3 files changed, 59 insertions(+), 11 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/PropertyTemplates/ColorEditorTemplate.template b/share/qtcreator/qmldesigner/propertyEditorQmlSources/PropertyTemplates/ColorEditorTemplate.template index 4ae345c678c..ad6e541ce90 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/PropertyTemplates/ColorEditorTemplate.template +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/PropertyTemplates/ColorEditorTemplate.template @@ -1,8 +1,5 @@ -Item { -} ColorEditor { - caption: "%1" backendValue: backendValues.%2 supportGradient: false } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/PropertyTemplates/TemplateTypes.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/PropertyTemplates/TemplateTypes.qml index f6a94e021bf..fd3fbfaee3b 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/PropertyTemplates/TemplateTypes.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/PropertyTemplates/TemplateTypes.qml @@ -49,6 +49,7 @@ AutoTypes { Type { typeNames: ["color", "QColor"] - sourceFile: "StringEditorTemplate.template" + sourceFile: "ColorEditorTemplate.template" + separateSection: true } } diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp index 39baecbaadd..12f12ed2bc7 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp @@ -408,18 +408,44 @@ QString PropertyEditorQmlBackend::templateGeneration(const NodeMetaInfo &type, if (!templateConfiguration() || !templateConfiguration()->isValid()) return QString(); + const auto nodes = templateConfiguration()->children(); + + QStringList sectorTypes; + + for (const QmlJS::SimpleReaderNode::Ptr &node : nodes) { + if (node->propertyNames().contains("separateSection")) + sectorTypes.append(variantToStringList(node->property("typeNames"))); + } + QStringList imports = variantToStringList(templateConfiguration()->property(QStringLiteral("imports"))); QString qmlTemplate = imports.join(QLatin1Char('\n')) + QLatin1Char('\n'); - qmlTemplate += QStringLiteral("Section {\n"); - qmlTemplate += QStringLiteral("caption: \"%1\"\n").arg(QString::fromUtf8(type.simplifiedTypeName())); - qmlTemplate += QStringLiteral("SectionLayout {\n"); + + qmlTemplate += "Column {\n"; + qmlTemplate += "anchors.left: parent.left\n"; + qmlTemplate += "anchors.right: parent.right\n"; QList orderedList = type.propertyNames(); - Utils::sort(orderedList); + Utils::sort(orderedList, [type, §orTypes](const PropertyName &left, const PropertyName &right){ + const QString typeNameLeft = QString::fromLatin1(type.propertyTypeName(left)); + const QString typeNameRight = QString::fromLatin1(type.propertyTypeName(right)); + if (typeNameLeft == typeNameRight) + return left > right; + + if (sectorTypes.contains(typeNameLeft)) { + if (sectorTypes.contains(typeNameRight)) + return left > right; + return true; + } else if (sectorTypes.contains(typeNameRight)) { + return false; + } + return left > right; + }); bool emptyTemplate = true; + bool sectionStarted = false; + foreach (const PropertyName &name, orderedList) { if (name.startsWith("__")) @@ -433,15 +459,35 @@ QString PropertyEditorQmlBackend::templateGeneration(const NodeMetaInfo &type, if (typeName == "alias" && node.isValid()) typeName = node.instanceType(name); + auto nodes = templateConfiguration()->children(); + if (!superType.hasProperty(name) && type.propertyIsWritable(name) && !name.contains(".")) { - foreach (const QmlJS::SimpleReaderNode::Ptr &node, templateConfiguration()->children()) + + foreach (const QmlJS::SimpleReaderNode::Ptr &node, nodes) if (variantToStringList(node->property(QStringLiteral("typeNames"))).contains(QString::fromLatin1(typeName))) { const QString fileName = propertyTemplatesPath() + node->property(QStringLiteral("sourceFile")).toString(); QFile file(fileName); if (file.open(QIODevice::ReadOnly)) { QString source = QString::fromUtf8(file.readAll()); file.close(); + const bool section = node->propertyNames().contains("separateSection"); + if (section) { + qmlTemplate += "Section {\n"; + qmlTemplate += "anchors.left: parent.left\n"; + qmlTemplate += "anchors.right: parent.right\n"; + qmlTemplate += QString("caption: \"%1\"\n").arg(QString::fromUtf8(properName)); + } else if (!sectionStarted) { + qmlTemplate += QStringLiteral("Section {\n"); + qmlTemplate += QStringLiteral("caption: \"%1\"\n").arg(QString::fromUtf8(type.simplifiedTypeName())); + qmlTemplate += "anchors.left: parent.left\n"; + qmlTemplate += "anchors.right: parent.right\n"; + qmlTemplate += QStringLiteral("SectionLayout {\n"); + sectionStarted = true; + } + qmlTemplate += source.arg(QString::fromUtf8(name)).arg(QString::fromUtf8(properName)); + if (section) + qmlTemplate += "}\n"; emptyTemplate = false; } else { qWarning().nospace() << "template definition source file not found:" << fileName; @@ -449,8 +495,12 @@ QString PropertyEditorQmlBackend::templateGeneration(const NodeMetaInfo &type, } } } - qmlTemplate += QStringLiteral("}\n"); //Section - qmlTemplate += QStringLiteral("}\n"); //SectionLayout + if (sectionStarted) { + qmlTemplate += QStringLiteral("}\n"); //Section + qmlTemplate += QStringLiteral("}\n"); //SectionLayout + } + + qmlTemplate += "}\n"; if (emptyTemplate) return QString(); From 0bcdc93e198aee53838a6315c11a82a483d0ad1b Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 12 Jun 2019 16:10:23 +0200 Subject: [PATCH 22/29] QmlDesigner: Fix layout in templates Because the templates did not use the pre-defined layout, the layout was bit broken. Change-Id: I3a11e78a8dd6ac81252fa51270de5d427e5de0c2 Reviewed-by: Tim Jenssen --- .../IntEditorTemplate.template | 18 ++++++++++------ .../RealEditorTemplate.template | 21 ++++++++++++------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/PropertyTemplates/IntEditorTemplate.template b/share/qtcreator/qmldesigner/propertyEditorQmlSources/PropertyTemplates/IntEditorTemplate.template index bd5a899d95a..981340e4cd1 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/PropertyTemplates/IntEditorTemplate.template +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/PropertyTemplates/IntEditorTemplate.template @@ -2,10 +2,16 @@ Label { text: "%1" tooltip: "%1" } -SpinBox { - maximumValue: 9999999 - minimumValue: -9999999 - backendValue: backendValues.%2 - Layout.fillWidth: true - Layout.maximumWidth: 100 + +SecondColumnLayout { + SpinBox { + maximumValue: 9999999 + minimumValue: -9999999 + backendValue: backendValues.%2 + Layout.fillWidth: true + Layout.maximumWidth: 100 + } + + ExpandingSpacer { + } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/PropertyTemplates/RealEditorTemplate.template b/share/qtcreator/qmldesigner/propertyEditorQmlSources/PropertyTemplates/RealEditorTemplate.template index d2a259c80e6..fbc24990c87 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/PropertyTemplates/RealEditorTemplate.template +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/PropertyTemplates/RealEditorTemplate.template @@ -2,12 +2,17 @@ Label { text: "%1" tooltip: "%1" } -SpinBox { - maximumValue: 9999999 - minimumValue: -9999999 - decimals: 2 - stepSize: 0.1 - backendValue: backendValues.%2 - Layout.fillWidth: true - Layout.maximumWidth: 100 + +SecondColumnLayout { + SpinBox { + maximumValue: 9999999 + minimumValue: -9999999 + decimals: 2 + stepSize: 0.1 + backendValue: backendValues.%2 + Layout.fillWidth: true + Layout.maximumWidth: 100 + } + ExpandingSpacer { + } } From bfd8c5d9eeeb2c0a1941825976442d724c9e0a9b Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Tue, 11 Jun 2019 18:14:07 +0200 Subject: [PATCH 23/29] Squish: Update tst_HELP04 Task-number: QTBUG-67737 Change-Id: I4808ddccbe4e83d42d24f17a80485b5464822825 Reviewed-by: Christian Stenger --- tests/system/suite_HELP/tst_HELP04/test.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/system/suite_HELP/tst_HELP04/test.py b/tests/system/suite_HELP/tst_HELP04/test.py index 1626e5d9b8d..8a3049c173a 100644 --- a/tests/system/suite_HELP/tst_HELP04/test.py +++ b/tests/system/suite_HELP/tst_HELP04/test.py @@ -26,7 +26,7 @@ source("../../shared/qtcreator.py") # test search in help mode and advanced search -searchKeywordDictionary={ "abundance":True, "deplmint":False, "QODBC":True, "bld":False } +searchKeywordDictionary = { "abundance":True, "deplmint":False, "QODBC":True, "bldx":False } urlDictionary = { "abundance":"qthelp://com.trolltech.qt.487/qdoc/gettingstarted-develop.html", "QODBC":"qthelp://com.trolltech.qt.487/qdoc/sql-driver.html" } @@ -93,7 +93,7 @@ def main(): clickButton(waitForObject("{text='Search' type='QPushButton' unnamed='1' visible='1' " "window=':Qt Creator_Core::Internal::MainWindow'}")) resultWidget = waitForObject(':Hits_QResultWidget', 5000) - if not JIRA.isBugStillOpen(67737, JIRA.Bug.QT): + if os.getenv("SYSTEST_BUILT_WITH_QT_5_13_1_OR_NEWER", "0") == "1": test.verify(waitFor("noMatch in " "str(resultWidget.plainText)", 2000), "Verifying if search did not match anything.") @@ -121,9 +121,10 @@ def main(): type(resultWidget, "") waitFor("__getUrl__() != url or selText != __getSelectedText__()", 20000) verifySelection(searchKeyword) - verifyUrl(urlDictionary[searchKeyword]) + if not (searchKeyword == "QODBC" and JIRA.isBugStillOpen(10331)): + verifyUrl(urlDictionary[searchKeyword]) else: - if not JIRA.isBugStillOpen(67737, JIRA.Bug.QT): + if os.getenv("SYSTEST_BUILT_WITH_QT_5_13_1_OR_NEWER", "0") == "1": test.verify(waitFor("noMatch in " "str(resultWidget.plainText)", 1000), "Verifying if search did not match anything for: " + searchKeyword) From 990d77498a69d07bf8a634c67408cb1ec71eb4fd Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 13 Jun 2019 11:05:59 +0200 Subject: [PATCH 24/29] LanguageClient: remove experimental flag Change-Id: I3406bdfc9663f8ef5ced4935941f4510902ed762 Reviewed-by: Eike Ziller Reviewed-by: Alessandro Portale --- src/plugins/languageclient/LanguageClient.json.in | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/languageclient/LanguageClient.json.in b/src/plugins/languageclient/LanguageClient.json.in index c48a74c937c..8eea5c88cc6 100644 --- a/src/plugins/languageclient/LanguageClient.json.in +++ b/src/plugins/languageclient/LanguageClient.json.in @@ -2,7 +2,6 @@ \"Name\" : \"LanguageClient\", \"Version\" : \"$$QTCREATOR_VERSION\", \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Experimental\" : true, \"Vendor\" : \"The Qt Company Ltd\", \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", \"License\" : [ \"Commercial Usage\", From 3959a4db14ad8cdedb79f0343bcee17655568cc9 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Wed, 12 Jun 2019 22:49:19 +0200 Subject: [PATCH 25/29] Squish: Update verifyBuildConfig Change-Id: I090957fc1a1af0d08714ad9d51d2873fa097b728 Reviewed-by: Christian Stenger --- tests/system/shared/build_utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/system/shared/build_utils.py b/tests/system/shared/build_utils.py index ee9037557fe..b27000701ee 100644 --- a/tests/system/shared/build_utils.py +++ b/tests/system/shared/build_utils.py @@ -166,7 +166,10 @@ def selectBuildConfig(wantedKit, configName, afterSwitchTo=ViewConstants.EDIT): def verifyBuildConfig(currentTarget, configName, shouldBeDebug=False, enableShadowBuild=False, enableQmlDebug=False): selectBuildConfig(currentTarget, configName, None) ensureChecked(waitForObject(":scrollArea.Details_Utils::DetailsButton")) - ensureChecked("{name='shadowBuildCheckBox' type='QCheckBox' visible='1'}", enableShadowBuild) + ensureChecked("{leftWidget={text='Shadow build:' type='QLabel' unnamed='1' visible='1' " + "window=':Qt Creator_Core::Internal::MainWindow'} " + "type='QCheckBox' unnamed='1' visible='1' " + "window=':Qt Creator_Core::Internal::MainWindow'}", enableShadowBuild) buildCfCombo = waitForObject("{type='QComboBox' name='buildConfigurationComboBox' visible='1' " "window=':Qt Creator_Core::Internal::MainWindow'}") if shouldBeDebug: From 58451e630df822f299e5e222957f954d57b1fc74 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 12 Jun 2019 10:57:33 +0200 Subject: [PATCH 26/29] Tests: Enable callgrind parser tests on Windows Change-Id: I7f8ebcc27b4acd9494fa30d87089d01454b35c48 Reviewed-by: Christian Kandeler --- tests/auto/valgrind/memcheck/memcheck.qbs | 1 + tests/auto/valgrind/valgrind.qbs | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/valgrind/memcheck/memcheck.qbs b/tests/auto/valgrind/memcheck/memcheck.qbs index c633a605a39..d695ba30a00 100644 --- a/tests/auto/valgrind/memcheck/memcheck.qbs +++ b/tests/auto/valgrind/memcheck/memcheck.qbs @@ -2,6 +2,7 @@ import qbs Project { name: "Memcheck autotests" + condition: !qbs.targetOS.contains("windows") references: [ "testapps/testapps.qbs", "modeldemo.qbs" diff --git a/tests/auto/valgrind/valgrind.qbs b/tests/auto/valgrind/valgrind.qbs index af50a1e8893..23b7e2cdbbf 100644 --- a/tests/auto/valgrind/valgrind.qbs +++ b/tests/auto/valgrind/valgrind.qbs @@ -2,7 +2,6 @@ import qbs Project { name: "Valgrind autotests" - condition: !qbs.targetOS.contains("windows") references: [ "callgrind/callgrind.qbs", "memcheck/memcheck.qbs" From f3ea8e34de6d6a8e175aee51de16c16074f8107c Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 13 Jun 2019 11:44:57 +0200 Subject: [PATCH 27/29] ProjectTree: Save state of "Hide Empty Directories" filter Change-Id: Iafd7248242e95dc0d5205649747f46d98e05873d Reviewed-by: Eike Ziller --- src/plugins/projectexplorer/projectmodels.cpp | 5 +++++ src/plugins/projectexplorer/projectmodels.h | 1 + src/plugins/projectexplorer/projecttreewidget.cpp | 7 +++++++ src/plugins/projectexplorer/projecttreewidget.h | 1 + 4 files changed, 14 insertions(+) diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index 49a9258f619..d69d9aad6a3 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -467,6 +467,11 @@ bool FlatModel::generatedFilesFilterEnabled() return m_filterGeneratedFiles; } +bool FlatModel::trimEmptyDirectoriesEnabled() +{ + return m_trimEmptyDirectories; +} + Node *FlatModel::nodeForIndex(const QModelIndex &index) const { WrapperNode *flatNode = itemForIndex(index); diff --git a/src/plugins/projectexplorer/projectmodels.h b/src/plugins/projectexplorer/projectmodels.h index 952fc096518..e406360f344 100644 --- a/src/plugins/projectexplorer/projectmodels.h +++ b/src/plugins/projectexplorer/projectmodels.h @@ -74,6 +74,7 @@ public: bool projectFilterEnabled(); bool generatedFilesFilterEnabled(); + bool trimEmptyDirectoriesEnabled(); void setProjectFilterEnabled(bool filter); void setGeneratedFilesFilterEnabled(bool filter); void setTrimEmptyDirectories(bool filter); diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index 641c1de40e4..af4334a21e1 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -552,6 +552,11 @@ bool ProjectTreeWidget::generatedFilesFilter() return m_model->generatedFilesFilterEnabled(); } +bool ProjectTreeWidget::trimEmptyDirectoriesFilter() +{ + return m_model->trimEmptyDirectoriesEnabled(); +} + bool ProjectTreeWidget::projectFilter() { return m_model->projectFilterEnabled(); @@ -594,6 +599,7 @@ void ProjectTreeWidgetFactory::saveSettings(QSettings *settings, int position, Q const QString baseKey = QLatin1String("ProjectTreeWidget.") + QString::number(position); settings->setValue(baseKey + QLatin1String(".ProjectFilter"), ptw->projectFilter()); settings->setValue(baseKey + QLatin1String(".GeneratedFilter"), ptw->generatedFilesFilter()); + settings->setValue(baseKey + QLatin1String(".TrimEmptyDirsFilter"), ptw->trimEmptyDirectoriesFilter()); settings->setValue(baseKey + QLatin1String(".SyncWithEditor"), ptw->autoSynchronization()); } @@ -604,5 +610,6 @@ void ProjectTreeWidgetFactory::restoreSettings(QSettings *settings, int position const QString baseKey = QLatin1String("ProjectTreeWidget.") + QString::number(position); ptw->setProjectFilter(settings->value(baseKey + QLatin1String(".ProjectFilter"), false).toBool()); ptw->setGeneratedFilesFilter(settings->value(baseKey + QLatin1String(".GeneratedFilter"), true).toBool()); + ptw->setTrimEmptyDirectories(settings->value(baseKey + QLatin1String(".TrimEmptyDirsFilter"), true).toBool()); ptw->setAutoSynchronization(settings->value(baseKey + QLatin1String(".SyncWithEditor"), true).toBool()); } diff --git a/src/plugins/projectexplorer/projecttreewidget.h b/src/plugins/projectexplorer/projecttreewidget.h index fb2abfc7026..6de41b0adf1 100644 --- a/src/plugins/projectexplorer/projecttreewidget.h +++ b/src/plugins/projectexplorer/projecttreewidget.h @@ -56,6 +56,7 @@ public: void setAutoSynchronization(bool sync); bool projectFilter(); bool generatedFilesFilter(); + bool trimEmptyDirectoriesFilter(); QToolButton *toggleSync(); Node *currentNode(); void sync(ProjectExplorer::Node *node); From 66dc83139821a978cf889ffb3a33a3f0fb11e6b0 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 13 Jun 2019 11:43:12 +0200 Subject: [PATCH 28/29] CMake: Do not QTC_ASSERT when Qml support is disabled Change-Id: Ifb84aeb252053e1e6d856650d6ec54c27d589fa0 Reviewed-by: Eike Ziller --- src/plugins/cmakeprojectmanager/cmakeproject.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index ec8e0d076d5..a9d4d76b964 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -311,9 +311,8 @@ void CMakeProject::updateProjectData(CMakeBuildConfiguration *bc) void CMakeProject::updateQmlJSCodeModel() { QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance(); - QTC_ASSERT(modelManager, return); - if (!activeTarget() || !activeTarget()->activeBuildConfiguration()) + if (!modelManager || !activeTarget() || !activeTarget()->activeBuildConfiguration()) return; QmlJS::ModelManagerInterface::ProjectInfo projectInfo = From 5f28af5e4d7f100019e562bcb21b321403e3fd8a Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 12 Jun 2019 10:56:20 +0200 Subject: [PATCH 29/29] Valgrind: Handle CRLF appropriate The valgrind parser might be used on Windows and if a device has Windows line endings it might end up with wrong data. Handle the additional line ending character if present. Change-Id: Ia86fa88f78b40e77e6236ed6769820e074a95db6 Reviewed-by: Christian Kandeler --- src/plugins/valgrind/callgrind/callgrindparser.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/valgrind/callgrind/callgrindparser.cpp b/src/plugins/valgrind/callgrind/callgrindparser.cpp index 153fa866db0..c80a30b99b6 100644 --- a/src/plugins/valgrind/callgrind/callgrindparser.cpp +++ b/src/plugins/valgrind/callgrind/callgrindparser.cpp @@ -283,6 +283,10 @@ void Parser::Private::parseHeader(QIODevice *device) while (!device->atEnd()) { QByteArray line = device->readLine(); + // last character will be ignored anyhow, but we might have CRLF; if so cut the last one + if (line.endsWith("\r\n")) + line.chop(1); + // now that we're done checking if we're done (heh) with the header, parse the address // and cost column descriptions. speed is unimportant here. if (line.startsWith('#')) { @@ -352,8 +356,9 @@ Parser::Private::NamePair Parser::Private::parseName(const char *begin, const ch void Parser::Private::dispatchLine(const QByteArray &line) { + int lineEnding = line.endsWith("\r\n") ? 2 : 1; const char *const begin = line.constData(); - const char *const end = begin + line.length() - 1; // we're not interested in the '\n' + const char *const end = begin + line.length() - lineEnding; // we're not interested in the '\n' const char *current = begin; // shortest possible line is "1 1" - a cost item line