diff --git a/doc/images/qtcreator-build-steps-cmake-ninja.png b/doc/images/qtcreator-build-steps-cmake-ninja.png new file mode 100644 index 00000000000..0f1ba4fa745 Binary files /dev/null and b/doc/images/qtcreator-build-steps-cmake-ninja.png differ diff --git a/doc/images/studio-curve-editor.png b/doc/images/studio-curve-editor.png new file mode 100644 index 00000000000..f1f82e0abee Binary files /dev/null and b/doc/images/studio-curve-editor.png differ diff --git a/doc/src/cmake/creator-projects-cmake-building.qdocinc b/doc/src/cmake/creator-projects-cmake-building.qdocinc index 8cc91516e8e..bca11658e4a 100644 --- a/doc/src/cmake/creator-projects-cmake-building.qdocinc +++ b/doc/src/cmake/creator-projects-cmake-building.qdocinc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -73,9 +73,42 @@ \image qtcreator-cmake-build-steps.png + \note While the other CMake generators are installed together with Qt, + you usually need to install Ninja yourself. For more information, see + \l {Using Ninja as a CMake Generator}. + //! [cmake build steps] +//! [cmake ninja] + + \section2 Using Ninja as a CMake Generator + + To use \l {https://ninja-build.org/}{Ninja} with CMake, you must install it + and select it as the CMake generator in the build and run kit: + + \list 1 + \li Install Ninja. + \li Add the path to the Ninja executable to the value of the PATH system + variable. + \li Select \uicontrol Tools > \uicontrol Options > \uicontrol Kits, and + then select the build and run kit for the project. + \li Select \uicontrol Change next to the \uicontrol {CMake generator} + field to open the \uicontrol {CMake Generator} dialog. + \image qtcreator-build-steps-cmake-ninja.png + \li In the \uicontrol Generator field, select \uicontrol Ninja. + \li Select \uicontrol OK to return to the \uicontrol Kits tab. + \li Select \uicontrol OK or \uicontrol Apply to save your changes. + \endlist + + \note To make sure that old build artifacts don't get in the way + the first time you build the project after the change, select + \uicontrol Build > \uicontrol {Rebuild Project}. This cleans up the + build directory and performs a new build. + +//! [cmake ninja] + + //! [cmake clean steps] \section2 CMake Clean Steps diff --git a/doc/src/projects/creator-only/creator-projects-targets.qdoc b/doc/src/projects/creator-only/creator-projects-targets.qdoc index 6438abc42bb..dc23a5e8348 100644 --- a/doc/src/projects/creator-only/creator-projects-targets.qdoc +++ b/doc/src/projects/creator-only/creator-projects-targets.qdoc @@ -194,6 +194,8 @@ choose the kit to use. To set the selected kit as the default kit, select \uicontrol {Make Default}. + \include creator-projects-cmake-building.qdocinc cmake ninja + \section1 Editing Qbs Profiles To view the Qbs profile associated with the kit, select \uicontrol Tools > diff --git a/doc/src/qtquick/qtquick-timeline.qdoc b/doc/src/qtquick/qtquick-timeline.qdoc index 3462330208d..de012b94e56 100644 --- a/doc/src/qtquick/qtquick-timeline.qdoc +++ b/doc/src/qtquick/qtquick-timeline.qdoc @@ -245,8 +245,11 @@ components can appear to pick up speed, slow down, or bounce back at the end of the animation. By default, the animations you specify on the timeline are \e linear, which means that they move from the beginning to - the end at a constant speed. You can use the curve picker to edit the - easing curve at a keyframe. + the end at a constant speed. You can use the \e {curve picker} to edit the + easing curve between two keyframes. You can also use the more advanced + \e {curve editor} to edit the curves for the whole animation. + + \section2 Attaching Easing Curves to Keyframes \image studio-curve-picker.png @@ -256,16 +259,16 @@ custom curve. For more information about easing curve types, see the documentation for \l [QML] {PropertyAnimation}{easing curves}. - To zoom into and out of the easing curve editor, use the mouse roller. To - reset the zoom factor, right-click in the editor and select + To zoom into and out of the easing curve picker, use the mouse roller. To + reset the zoom factor, right-click in the picker and select \uicontrol {Reset Zoom}. - To select easing curves: + To attach easing curves to keyframes: \list 1 \li Select a keyframe on the timeline. \li Select \uicontrol {Curve Picker (C)} on the toolbar, or press - \key C to open the \uicontrol {Easing Curve Editor} dialog. + \key C to open the curve picker. \li Select an easing curve in the \uicontrol Presets tab. \li In the \uicontrol {Duration (ms)} field, select the duration of the easing function in milliseconds. @@ -279,11 +282,13 @@ to \inlineimage keyframe_manualbezier_inactive.png . + \section2 Customizing Easing Curves + To customize easing curves: \list 1 - \li In the \uicontrol {Easing Curve Editor} dialog, select an easing - curve in the \uicontrol Presets tab. + \li In the curve picker, select an easing curve in the + \uicontrol Presets tab. \li Drag the curve handlers to modify the curve. \li Right-click in the editor, and select \uicontrol {Add Point} to add points to the curve. @@ -299,6 +304,32 @@ To paste easing curve definitions to the curve picker as text, select the \uicontrol Text tab. + \section1 Editing Animation Curves + + In the curve editor, you can view and modify the whole animation curve. You + can insert keyframes to the curve and drag them and the point handlers to + modify the curve. You can modify the appearance of the curve in the style + editor. + + You can also edit easing curves that you added with the curve picker. + + \image studio-curve-editor.png + + To edit animation curves: + + \list 1 + \li In the \uicontrol Timeline view, insert at least one keyframe. + \li Select \inlineimage curveGraphIcon.png + (\uicontrol {Curve Editor (C)} on the toolbar or press \key C + to open the curve editor. + \li Right-click in the curve editor, and select + \uicontrol {Insert Keyframe} to add a keyframe. + \li Select keyframes to display the easing curves attached to them. + To select multiple keyframes, press and hold \key Ctrl. + \endlist + + Your changes are automatically saved when you close the editor. + \section1 Rotating Items To animate components that rotate around a central point, you can use the diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AdvancedSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AdvancedSection.qml index 6d9c073c77a..ab6b17dd12b 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AdvancedSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AdvancedSection.qml @@ -53,8 +53,8 @@ Section { backendValue: backendValues.scale hasSlider: true decimals: 2 - minimumValue: 0.01 stepSize: 0.1 + minimumValue: -10 maximumValue: 10 Layout.preferredWidth: 140 } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AnchorRow.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AnchorRow.qml index 2514fde1d30..602a713b6ab 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AnchorRow.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AnchorRow.qml @@ -62,7 +62,7 @@ RowLayout { property alias buttonRow: buttonRow - readonly property color __defaultTextColor: Theme.color(Theme.PanelTextColorLight) + readonly property color __defaultTextColor: StudioTheme.Values.themeTextColor IconLabel { id: icon @@ -135,13 +135,13 @@ RowLayout { id: group } - StudioControls.AbstractButton { + 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.") + tooltip: verticalAnchor ? qsTr("Anchor to the top of the target.") : qsTr("Anchor to the left of the target.") onClicked: { if (!invertRelativeTargets) sameEdgeButtonClicked(); @@ -149,22 +149,22 @@ RowLayout { oppositeEdgeButtonClicked(); } } - StudioControls.AbstractButton { + 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.") + tooltip: verticalAnchor ? qsTr("Anchor to the vertical center of the target.") : qsTr("Anchor to the horizontal center of the target.") onClicked: centerButtonClicked(); } - StudioControls.AbstractButton { + 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.") + tooltip: verticalAnchor ? qsTr("Anchor to the bottom of the target.") : qsTr("Anchor to the right of the target.") onClicked: { if (!invertRelativeTargets) oppositeEdgeButtonClicked(); diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/PopupSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/PopupSection.qml index 0f2cb21b306..6b0b0de8355 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/PopupSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/PopupSection.qml @@ -158,8 +158,8 @@ Section { } SecondColumnLayout { SpinBox { - maximumValue: 9999999 - minimumValue: -9999999 + minimumValue: -4000 + maximumValue: 4000 decimals: 0 backendValue: backendValues.spacing Layout.fillWidth: true diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ImageSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ImageSpecifics.qml index ebf07866aa8..8f742f06e24 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ImageSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ImageSpecifics.qml @@ -80,8 +80,8 @@ Column { SpinBox { backendValue: backendValues.sourceSize_width - minimumValue: -2000 - maximumValue: 2000 + minimumValue: 0 + maximumValue: 8192 decimals: 0 } @@ -97,8 +97,8 @@ Column { SpinBox { backendValue: backendValues.sourceSize_height - minimumValue: -2000 - maximumValue: 2000 + minimumValue: 0 + maximumValue: 8192 decimals: 0 } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ListViewSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ListViewSpecifics.qml index ed3d74304bc..058cbb724a3 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ListViewSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ListViewSpecifics.qml @@ -130,8 +130,8 @@ Column { SectionLayout { SpinBox { backendValue: backendValues.spacing - minimumValue: 0 - maximumValue: 1000 + minimumValue: -4000 + maximumValue: 4000 decimals: 0 } ExpandingSpacer { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/PathViewSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/PathViewSpecifics.qml index f3bd9d9b3d3..b2d48045ecb 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/PathViewSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/PathViewSpecifics.qml @@ -166,6 +166,7 @@ Column { backendValue: backendValues.preferredHighlightBegin minimumValue: 0 maximumValue: 1 + stepSize: 0.1 decimals: 2 } ExpandingSpacer { @@ -182,6 +183,7 @@ Column { backendValue: backendValues.preferredHighlightEnd minimumValue: 0 maximumValue: 1 + stepSize: 0.1 decimals: 2 } ExpandingSpacer { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorButton.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorButton.qml index f960e5ea238..cb896024e93 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorButton.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorButton.qml @@ -43,6 +43,7 @@ Item { property bool block: false signal clicked + signal rightMouseButtonClicked onAlphaChanged: invalidateColor(); onSaturationChanged: invalidateColor(); @@ -202,7 +203,7 @@ Item { id: mapMouseArea anchors.fill: parent onPositionChanged: { - if (pressed) { + if (pressed && mouse.button === Qt.LeftButton) { var xx = Math.max(0, Math.min(mouse.x, parent.width)) var yy = Math.max(0, Math.min(mouse.y, parent.height)) @@ -210,8 +211,21 @@ Item { colorButton.saturation = xx / parent.width; } } - onPressed: positionChanged(mouse) - onReleased: colorButton.clicked() + onPressed: { + if (mouse.button === Qt.LeftButton) + positionChanged(mouse) + } + onReleased: { + if (mouse.button === Qt.LeftButton) + colorButton.clicked() + } + + acceptedButtons: Qt.LeftButton | Qt.RightButton + + onClicked: { + if (mouse.button === Qt.RightButton) + colorButton.rightMouseButtonClicked() + } } Rectangle { anchors.fill: parent diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorCheckButton.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorCheckButton.qml index 5f094dc00d9..9751c7c777a 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorCheckButton.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorCheckButton.qml @@ -26,12 +26,13 @@ import QtQuick 2.1 Item { - id: colorCheckButtonRoot + id: root property bool checked: false property alias buttonColor: checkBox.color width: 30 height: 24 + signal rightMouseButtonClicked Rectangle { id: backgroundBox @@ -63,13 +64,20 @@ Item { anchors.right: backgroundBox.left anchors.rightMargin: 2 opacity: colorToolTip.containsMouse ? 1 : 0.8 - rotation: colorCheckButtonRoot.checked ? 0.0 : 270.0 + rotation: root.checked ? 0.0 : 270.0 } ToolTipArea { id: colorToolTip - onClicked: checked = !checked + acceptedButtons: Qt.LeftButton | Qt.RightButton + + onClicked: { + if (mouse.button === Qt.RightButton) + root.rightMouseButtonClicked() + else + root.checked = !root.checked + } hoverEnabled: true anchors.fill: parent anchors.leftMargin: -arrowImage.width diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml index 15246a4405a..ade6b3e5268 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml @@ -26,6 +26,8 @@ import QtQuick 2.1 import QtQuick.Layouts 1.0 import QtQuickDesignerTheme 1.0 +import QtQuick.Dialogs 1.3 +import StudioControls 1.0 as StudioControls Column { id: colorEditor @@ -198,6 +200,12 @@ Column { ColorCheckButton { id: checkButton buttonColor: colorEditor.color + + onCheckedChanged: { + if (contextMenu.opened) + contextMenu.close() + } + onRightMouseButtonClicked: contextMenu.popup(checkButton) } LineEdit { @@ -615,7 +623,13 @@ Column { sliderMargins: 4 - onClicked: colorEditor.color = colorButton.color + onClicked: { + colorEditor.color = colorButton.color + if (contextMenu.opened) + contextMenu.close() + } + + onRightMouseButtonClicked: contextMenu.popup(colorButton) } Item { @@ -702,13 +716,23 @@ Column { clickable: !colorEditor.transparent - onSelectedColorChanged: { - colorEditor.color = colorPalette.selectedColor; - } + onSelectedColorChanged: colorEditor.color = colorPalette.selectedColor + + + onDialogColorChanged: colorEditor.color = colorPalette.selectedColor } } } } } + + StudioControls.Menu { + id: contextMenu + + StudioControls.MenuItem { + text: qsTr("Open Color Dialog") + onTriggered: colorPalette.showColorDialog(colorEditor.color) + } + } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableSection.qml index 8725ba6979c..2b97df06467 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableSection.qml @@ -34,6 +34,7 @@ Section { id: root + property int labelWidth: 42 property int spinBoxWidth: 96 SectionLayout { @@ -173,13 +174,13 @@ Section { Label { text: "W" - width: 42 + width: root.labelWidth } SpinBox { backendValue: backendValues.contentWidth minimumValue: 0 - maximumValue: 8000 + maximumValue: 10000 implicitWidth: root.spinBoxWidth Layout.fillWidth: true } @@ -191,13 +192,13 @@ Section { Label { text: "H" - width: 42 + width: root.labelWidth } SpinBox { backendValue: backendValues.contentHeight minimumValue: 0 - maximumValue: 8000 + maximumValue: 10000 implicitWidth: root.spinBoxWidth Layout.fillWidth: true } @@ -213,12 +214,12 @@ Section { Label { text: "X" - width: 42 + width: root.labelWidth } SpinBox { backendValue: backendValues.contentX - minimumValue: 0 + minimumValue: -8000 maximumValue: 8000 implicitWidth: root.spinBoxWidth Layout.fillWidth: true @@ -231,12 +232,12 @@ Section { Label { text: "Y" - width: 42 + width: root.labelWidth } SpinBox { backendValue: backendValues.contentY - minimumValue: 0 + minimumValue: -8000 maximumValue: 8000 implicitWidth: root.spinBoxWidth Layout.fillWidth: true @@ -254,13 +255,13 @@ Section { Label { text: "Top" - width: 42 + width: root.labelWidth } SpinBox { backendValue: backendValues.topMargin - maximumValue: 0xffff - minimumValue: 0 + minimumValue: -10000 + maximumValue: 10000 decimals: 0 implicitWidth: root.spinBoxWidth Layout.fillWidth: true @@ -273,13 +274,13 @@ Section { Label { text: "Bottom" - width: 42 + width: root.labelWidth } SpinBox { backendValue: backendValues.bottomMargin - maximumValue: 0xffff - minimumValue: 0 + minimumValue: -10000 + maximumValue: 10000 decimals: 0 implicitWidth: root.spinBoxWidth Layout.fillWidth: true @@ -297,13 +298,13 @@ Section { Label { text: "Left" - width: 42 + width: root.labelWidth } SpinBox { backendValue: backendValues.leftMargin - maximumValue: 0xffff - minimumValue: 0 + minimumValue: -10000 + maximumValue: 10000 decimals: 0 implicitWidth: root.spinBoxWidth Layout.fillWidth: true @@ -316,13 +317,13 @@ Section { Label { text: "Right" - width: 42 + width: root.labelWidth } SpinBox { backendValue: backendValues.rightMargin - maximumValue: 0xffff - minimumValue: 0 + minimumValue: -10000 + maximumValue: 10000 decimals: 0 implicitWidth: root.spinBoxWidth Layout.fillWidth: true diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Label.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Label.qml index e4129c6dcff..ce1a0d41540 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Label.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Label.qml @@ -38,7 +38,7 @@ Controls.Label { property alias toolTip: toolTipArea.tooltip width: Math.max(Math.min(240, parent.width - 280), 50) - color: Theme.color(Theme.PanelTextColorLight) + color: StudioTheme.Values.themeTextColor elide: Text.ElideRight font.pixelSize: StudioTheme.Values.myFontSize diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/MarginSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/MarginSection.qml index 153d7cb27b1..63b8f8702b4 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/MarginSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/MarginSection.qml @@ -45,8 +45,8 @@ Section { width: 42 } SpinBox { - maximumValue: 9999999 - minimumValue: -9999999 + minimumValue: -10000 + maximumValue: 10000 decimals: 0 backendValue: backendValues.topMargin Layout.fillWidth: true @@ -62,8 +62,8 @@ Section { width: 42 } SpinBox { - maximumValue: 9999999 - minimumValue: -9999999 + minimumValue: -10000 + maximumValue: 10000 decimals: 0 backendValue: backendValues.bottomMargin Layout.fillWidth: true @@ -80,8 +80,8 @@ Section { width: 42 } SpinBox { - maximumValue: 9999999 - minimumValue: -9999999 + minimumValue: -10000 + maximumValue: 10000 decimals: 0 backendValue: backendValues.leftMargin Layout.fillWidth: true @@ -97,8 +97,8 @@ Section { width: 42 } SpinBox { - maximumValue: 9999999 - minimumValue: -9999999 + minimumValue: -10000 + maximumValue: 10000 decimals: 0 backendValue: backendValues.rightMargin Layout.fillWidth: true @@ -111,8 +111,8 @@ Section { } SecondColumnLayout { SpinBox { - maximumValue: 9999999 - minimumValue: -9999999 + minimumValue: -10000 + maximumValue: 10000 decimals: 0 backendValue: backendValues.margins Layout.fillWidth: true diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml index 10b09287b71..583b11ee9a5 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml @@ -24,7 +24,7 @@ ****************************************************************************/ import QtQuick 2.1 -import QtQuick.Controls 1.1 as Controls +import QtQuick.Controls 2.12 as Controls import QtQuick.Layouts 1.0 import QtQuickDesignerTheme 1.0 import StudioTheme 1.0 as StudioTheme @@ -52,7 +52,7 @@ Item { Controls.Label { id: label anchors.verticalCenter: parent.verticalCenter - color: Theme.color(Theme.PanelTextColorLight) + color: StudioTheme.Values.themeTextColor x: 22 font.bold: true font.pixelSize: StudioTheme.Values.myFontSize @@ -75,7 +75,7 @@ Item { } - color: Theme.color(Theme.BackgroundColorDark) + color: StudioTheme.Values.themeSectionHeadBackground Rectangle { visible: false diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SimpleColorPalette.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SimpleColorPalette.qml index 9cc787bd235..d69fc08e4b6 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SimpleColorPalette.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SimpleColorPalette.qml @@ -32,7 +32,12 @@ import QtQuick.Controls.Private 1.0 // showing a ToolTip Item { property color selectedColor property bool clickable : true + property color oldColor + function showColorDialog(color) { + oldColor = color + paletteModel.showDialog(color) + } width: 200 height: 40 @@ -43,6 +48,8 @@ Item { paletteModel.addItem(colorCode) } + signal dialogColorChanged + Component { id: colorItemDelegate @@ -94,7 +101,20 @@ Item { } } - SimpleColorPaletteModel { id: paletteModel } + SimpleColorPaletteModel { + + id: paletteModel + + onCurrentColorChanged: { + selectedColor = color + dialogColorChanged() + + } + onColorDialogRejected: { + selectedColor = oldColor + dialogColorChanged() + } + } ListView { id: colorPaletteView model: paletteModel diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSliderPopup.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSliderPopup.qml index d260940c394..fe83e82ee60 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSliderPopup.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSliderPopup.qml @@ -81,11 +81,8 @@ T.Popup { } onMoved: { - var currValue = myControl.value myControl.realValue = slider.value - - if (currValue !== myControl.realValue) - myControl.realValueModified() + myControl.realValueModified() } } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBox.qml index 3f0d1296e52..39cd51d2887 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBox.qml @@ -71,6 +71,8 @@ T.SpinBox { property real __sliderIndicatorWidth: StudioTheme.Values.squareComponentWidth property real __sliderIndicatorHeight: StudioTheme.Values.height + property alias compressedValueTimer: myTimer + signal realValueModified signal compressedRealValueModified signal dragStarted diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxInput.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxInput.qml index 7de0eb735e7..72a713c2820 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxInput.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxInput.qml @@ -88,6 +88,10 @@ TextInput { // Force focus on the non visible component to receive key events dragModifierWorkaround.forceActiveFocus() } else { + if (myControl.compressedValueTimer.running) { + myControl.compressedValueTimer.stop() + calcValue(myControl.compressedRealValueModified) + } mouseArea.cursorShape = Qt.PointingHandCursor // TODO myControl.drag = false myControl.dragEnded() @@ -97,15 +101,13 @@ TextInput { myControl.focus = false } } - onTranslationChanged: calcValue() - onMultiplierChanged: calcValue() + onTranslationChanged: calcValue(myControl.realValueModified) + onMultiplierChanged: calcValue(myControl.realValueModified) - function calcValue() { + function calcValue(callback) { var tmp = myControl.realDragRange / StudioTheme.Values.dragLength - var currValue = myControl.realValue myControl.setRealValue(dragHandler.initialValue + (tmp * dragHandler.translation.x * dragHandler.multiplier)) - if (currValue !== myControl.realValue) - myControl.realValueModified() + callback() } } @@ -161,12 +163,9 @@ TextInput { if (wheel.modifiers & Qt.ShiftModifier) mouseArea.stepSize = myControl.maxStepSize - var currValue = myControl.realValue myControl.valueFromText(textInput.text, myControl.locale) myControl.setRealValue(myControl.realValue + (wheel.angleDelta.y / 120.0 * mouseArea.stepSize)) - - if (currValue !== myControl.realValue) - myControl.realValueModified() + myControl.realValueModified() // Reset stepSize mouseArea.stepSize = myControl.realStepSize diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml index 46d2141adc5..32136421a46 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml @@ -123,6 +123,8 @@ QtObject { property string themeTranslationIndicatorBorder: "#7f7f7f" + property string themeSectionHeadBackground: "#191919" + // Taken out of Constants.js property string themeChangedStateText: "#99ccff" } diff --git a/src/libs/qtcreatorcdbext/pycdbextmodule.cpp b/src/libs/qtcreatorcdbext/pycdbextmodule.cpp index fc55076ea68..c1584587c0c 100644 --- a/src/libs/qtcreatorcdbext/pycdbextmodule.cpp +++ b/src/libs/qtcreatorcdbext/pycdbextmodule.cpp @@ -220,12 +220,17 @@ static PyObject *cdbext_listOfLocals(PyObject *, PyObject *args) // -> [ Value ] ++currentPartialIname; // skip "local" part ULONG symbolGroupIndex = 0; + ULONG childEndIndex = 0; for (;symbolGroupIndex < scopeEnd; ++symbolGroupIndex) { - const PyValue value(symbolGroupIndex, symbolGroup); - if (value.name() == *currentPartialIname) { - PyList_Append(locals, createPythonObject(value)); - return locals; + PyValue value(symbolGroupIndex, symbolGroup); + if (childEndIndex <= symbolGroupIndex) { // do not return a child value + if (value.name() == *currentPartialIname) { + PyList_Append(locals, createPythonObject(value)); + return locals; + } + ++childEndIndex; } + childEndIndex += ULONG(value.childCount()); } } diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp index d5685a161e9..7a711923ccd 100644 --- a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp @@ -296,8 +296,11 @@ void GraphicsView::contextMenuEvent(QContextMenuEvent *event) auto openStyleEditor = [this]() { m_dialog.show(); }; QMenu menu; - QAction *openEditorAction = menu.addAction(tr("Open Style Editor")); - connect(openEditorAction, &QAction::triggered, openStyleEditor); + + if (qEnvironmentVariableIsSet("QTC_STYLE_CURVE_EDITOR")) { + QAction *openEditorAction = menu.addAction(tr("Open Style Editor")); + connect(openEditorAction, &QAction::triggered, openStyleEditor); + } menu.addSeparator(); auto insertKeyframes = [this, event]() { diff --git a/src/plugins/qmldesigner/components/propertyeditor/simplecolorpalettemodel.cpp b/src/plugins/qmldesigner/components/propertyeditor/simplecolorpalettemodel.cpp index b3207f0006d..a67a2fc91f6 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/simplecolorpalettemodel.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/simplecolorpalettemodel.cpp @@ -29,10 +29,14 @@ #include "designersettings.h" +#include + +#include #include #include #include #include +#include namespace QmlDesigner { @@ -143,4 +147,16 @@ void SimpleColorPaletteModel::write() SimpleColorPaletteSingleton::getInstance().writePalette(); } +void SimpleColorPaletteModel::showDialog(QColor color) +{ + auto colorDialog = new QColorDialog(Core::ICore::dialogParent()); + colorDialog->setCurrentColor(color); + colorDialog->setAttribute(Qt::WA_DeleteOnClose); + + connect(colorDialog, &QDialog::rejected, this, &SimpleColorPaletteModel::colorDialogRejected); + connect(colorDialog, &QColorDialog::currentColorChanged, this, &SimpleColorPaletteModel::currentColorChanged); + + QTimer::singleShot(0, [colorDialog](){ colorDialog->exec(); }); +} + } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/components/propertyeditor/simplecolorpalettemodel.h b/src/plugins/qmldesigner/components/propertyeditor/simplecolorpalettemodel.h index 3ed2cc8a31d..c1babf263e3 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/simplecolorpalettemodel.h +++ b/src/plugins/qmldesigner/components/propertyeditor/simplecolorpalettemodel.h @@ -28,6 +28,7 @@ #include #include #include +#include namespace QmlDesigner { @@ -59,6 +60,12 @@ public: bool read(); void write(); + Q_INVOKABLE void showDialog(QColor color); + +signals: + void colorDialogRejected(); + void currentColorChanged(const QColor &color); + private slots: void setPalette(); diff --git a/src/plugins/qmldesigner/components/propertyeditor/simplecolorpalettesingleton.h b/src/plugins/qmldesigner/components/propertyeditor/simplecolorpalettesingleton.h index 77ad2b0732a..8a2019a1d76 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/simplecolorpalettesingleton.h +++ b/src/plugins/qmldesigner/components/propertyeditor/simplecolorpalettesingleton.h @@ -29,7 +29,6 @@ #include #include #include -#include #include namespace QmlDesigner { diff --git a/src/plugins/qmldesigner/components/timelineeditor/animationcurvedialog.cpp b/src/plugins/qmldesigner/components/timelineeditor/animationcurvedialog.cpp index abc77781252..08269f0a927 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/animationcurvedialog.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/animationcurvedialog.cpp @@ -33,7 +33,6 @@ AnimationCurveDialog::AnimationCurveDialog(QWidget *parent) : QDialog(parent) , m_editor(nullptr) { - setWindowFlag(Qt::WindowStaysOnTopHint, true); setWindowFlag(Qt::WindowContextHelpButtonHint, false); } @@ -41,7 +40,6 @@ AnimationCurveDialog::AnimationCurveDialog(DesignTools::CurveEditorModel *model, : QDialog(parent) , m_editor(nullptr) { - setWindowFlag(Qt::WindowStaysOnTopHint, true); setWindowFlag(Qt::WindowContextHelpButtonHint, false); setModel(model); } diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp index 33c6dafa343..6e6ae34e433 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp @@ -40,6 +40,7 @@ #include #include +#include #include @@ -101,7 +102,7 @@ QAction *createAction(const Core::Id &id, TimelineToolBar::TimelineToolBar(QWidget *parent) : QToolBar(parent) , m_grp() - , m_dialog() + , m_dialog(Core::ICore::dialogParent()) , m_curveModel(new AnimationCurveEditorModel(0., 500.)) { m_dialog.setModel(m_curveModel); @@ -221,7 +222,7 @@ void TimelineToolBar::removeTimeline(const QmlTimeline &timeline) void TimelineToolBar::openAnimationCurveEditor() { - m_dialog.open(); + m_dialog.show(); } void TimelineToolBar::updateCurve(DesignTools::PropertyTreeItem *item) diff --git a/src/shared/qbs b/src/shared/qbs index 817a292690c..53673312503 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 817a292690ccdea7bae185319beb22ea653db946 +Subproject commit 5367331250368ada068c02c3027369e1d7a59ee7