diff options
author | Aleksei German <aleksei.german@qt.io> | 2020-08-31 18:37:22 +0200 |
---|---|---|
committer | Aleksei German <aleksei.german@qt.io> | 2020-09-01 10:03:53 +0000 |
commit | f43b81ae6f0be61b492e07fc306b7a2dc8a2ef3d (patch) | |
tree | a1b682e1b49ba13f659e1a4f22c93cc0c063f8ca /share | |
parent | e65e4b81ea1c84355f649d9eac885ba1acb51c06 (diff) |
QmlDesigner: Disable Properties unavailable in QUL
Disabling properties in:
MouseArea
Flickable
Image
Text (including Font)
Change-Id: Id0a44fa73ff80bf4749c0bdc0f9eac3e2f488762
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'share')
7 files changed, 102 insertions, 6 deletions
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ImageSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ImageSpecifics.qml index 60b97a1179..864dd51ceb 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ImageSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ImageSpecifics.qml @@ -70,12 +70,14 @@ Column { Label { text: qsTr("Source size") + disabledState: !backendValues.sourceSize.isAvailable } SecondColumnLayout { Label { text: "W" width: 12 + disabledState: !backendValues.sourceSize_width.isAvailable } SpinBox { @@ -83,6 +85,7 @@ Column { minimumValue: 0 maximumValue: 8192 decimals: 0 + enabled: backendValue.isAvailable } Item { @@ -93,6 +96,7 @@ Column { Label { text: "H" width: 12 + disabledState: !backendValues.sourceSize_height.isAvailable } SpinBox { @@ -100,6 +104,7 @@ Column { minimumValue: 0 maximumValue: 8192 decimals: 0 + enabled: backendValue.isAvailable } ExpandingSpacer { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/MouseAreaSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/MouseAreaSpecifics.qml index 0ca7f3d888..dd42326fe0 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/MouseAreaSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/MouseAreaSpecifics.qml @@ -40,6 +40,7 @@ Column { Label { text: qsTr("Enabled") tooltip: qsTr("This property holds whether the item accepts mouse events.") + disabledState: !backendValues.enabled.isAvailable } SecondColumnLayout { @@ -47,6 +48,7 @@ Column { Layout.fillWidth: true backendValue: backendValues.enabled text: backendValues.enabled.valueToString + enabled: backendValue.isAvailable } ExpandingSpacer { @@ -56,6 +58,7 @@ Column { Label { text: qsTr("Hover enabled") tooltip: qsTr("This property holds whether hover events are handled.") + disabledState: !backendValues.hoverEnabled.isAvailable } SecondColumnLayout { @@ -63,6 +66,7 @@ Column { Layout.fillWidth: true backendValue: backendValues.hoverEnabled text: backendValues.hoverEnabled.valueToString + enabled: backendValue.isAvailable } ExpandingSpacer { @@ -72,6 +76,7 @@ Column { Label { text: qsTr("Accepted buttons") tooltip: qsTr("This property holds the mouse buttons that the mouse area reacts to.") + disabledState: !backendValues.acceptedButtons.isAvailable } SecondColumnLayout { @@ -80,6 +85,7 @@ Column { model: ["LeftButton", "RightButton", "MiddleButton", "BackButton", "ForwardButton", "AllButtons"] Layout.fillWidth: true scope: "Qt" + enabled: backendValue.isAvailable } ExpandingSpacer { } @@ -104,6 +110,7 @@ Column { Label { text: qsTr("Scroll gesture enabled") tooltip: qsTr("This property controls whether this MouseArea responds to scroll gestures from non-mouse devices.") + disabledState: !backendValues.scrollGestureEnabled.isAvailable } SecondColumnLayout { @@ -111,6 +118,7 @@ Column { Layout.fillWidth: true backendValue: backendValues.scrollGestureEnabled text: backendValues.scrollGestureEnabled.valueToString + enabled: backendValue.isAvailable } ExpandingSpacer { @@ -120,6 +128,7 @@ Column { Label { text: qsTr("Cursor shape") tooltip: qsTr("This property holds the cursor shape for this mouse area.") + disabledState: !backendValues.cursorShape.isAvailable } SecondColumnLayout { @@ -133,6 +142,7 @@ Column { "DragMoveCursor", "DragLinkCursor"] Layout.fillWidth: true scope: "Qt" + enabled: backendValue.isAvailable } ExpandingSpacer { } @@ -141,6 +151,7 @@ Column { Label { text: qsTr("Prevent stealing") tooltip: qsTr("This property controls whether the mouse events may be stolen from this MouseArea.") + disabledState: !backendValues.preventStealing.isAvailable } SecondColumnLayout { @@ -148,6 +159,7 @@ Column { Layout.fillWidth: true backendValue: backendValues.preventStealing text: backendValues.preventStealing.valueToString + enabled: backendValue.isAvailable } ExpandingSpacer { @@ -157,6 +169,7 @@ Column { Label { text: qsTr("Propagate composed events") tooltip: qsTr("This property controls whether composed mouse events will automatically propagate to other MouseAreas.") + disabledState: !backendValues.propagateComposedEvents.isAvailable } SecondColumnLayout { @@ -164,6 +177,7 @@ Column { Layout.fillWidth: true backendValue: backendValues.propagateComposedEvents text: backendValues.propagateComposedEvents.valueToString + enabled: backendValue.isAvailable } ExpandingSpacer { @@ -176,6 +190,7 @@ Column { anchors.left: parent.left anchors.right: parent.right caption: qsTr("Drag") + visible: backendValues.drag_target.isAvailable SectionLayout { Label { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/TextSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/TextSpecifics.qml index 550ffb3240..7b79e76f0c 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/TextSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/TextSpecifics.qml @@ -56,6 +56,7 @@ Column { anchors.left: parent.left anchors.right: parent.right caption: qsTr("Style Color") + visible: backendValues.styleColor.isAvailable ColorEditor { caption: qsTr("Style Color") diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableSection.qml index 11f46d29c5..5501a14cda 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableSection.qml @@ -42,6 +42,7 @@ Section { Label { text: qsTr("Flick direction") + disabledState: !backendValues.flickableDirection.isAvailable } SecondColumnLayout { @@ -50,6 +51,7 @@ Section { model: ["AutoFlickDirection", "AutoFlickIfNeeded", "HorizontalFlick", "VerticalFlick", "HorizontalAndVerticalFlick"] Layout.fillWidth: true scope: "Flickable" + enabled: backendValue.isAvailable } ExpandingSpacer { } @@ -58,6 +60,7 @@ Section { Label { text: qsTr("Behavior") tooltip: qsTr("Determines whether the surface may be dragged beyond the Flickable's boundaries, or overshoot the Flickable's boundaries when flicked.") + disabledState: !backendValues.boundsBehavior.isAvailable } SecondColumnLayout { @@ -66,6 +69,7 @@ Section { model: ["StopAtBounds", "DragOverBounds", "OvershootBounds", "DragAndOvershootBounds"] Layout.fillWidth: true scope: "Flickable" + enabled: backendValue.isAvailable } ExpandingSpacer { } @@ -75,6 +79,7 @@ Section { Label { text: qsTr("Movement") tooltip: qsTr("Determines whether the Flickable will give a feeling that the edges of the view are soft, rather than a hard physical boundary.") + disabledState: !backendValues.boundsMovement.isAvailable } SecondColumnLayout { @@ -83,6 +88,7 @@ Section { model: ["FollowBoundsBehavior", "StopAtBounds"] Layout.fillWidth: true scope: "Flickable" + enabled: backendValue.isAvailable } ExpandingSpacer { } @@ -122,6 +128,7 @@ Section { Label { text: qsTr("Deceleration") tooltip: qsTr("Flick deceleration") + disabledState: !backendValues.flickDeceleration.isAvailable } SecondColumnLayout { @@ -130,6 +137,7 @@ Section { minimumValue: 0 maximumValue: 8000 decimals: 0 + enabled: backendValue.isAvailable } ExpandingSpacer { } @@ -138,6 +146,7 @@ Section { Label { text: qsTr("Press delay") tooltip: qsTr("Holds the time to delay (ms) delivering a press to children of the Flickable.") + disabledState: !backendValues.pressDelay.isAvailable } SecondColumnLayout { @@ -146,6 +155,7 @@ Section { minimumValue: 0 maximumValue: 2000 decimals: 0 + enabled: backendValue.isAvailable } ExpandingSpacer { } @@ -154,6 +164,7 @@ Section { Label { text: qsTr("Pixel aligned") tooltip: qsTr("Sets the alignment of contentX and contentY to pixels (true) or subpixels (false).") + disabledState: !backendValues.pixelAligned.isAvailable } SecondColumnLayout { @@ -161,6 +172,7 @@ Section { Layout.fillWidth: true backendValue: backendValues.pixelAligned text: backendValues.pixelAligned.valueToString + enabled: backendValue.isAvailable } ExpandingSpacer { } @@ -171,6 +183,7 @@ Section { tooltip: qsTr("If set to true, then when the mouse or touchpoint moves far enough to begin dragging\n" + "the content, the content will jump, such that the content pixel which was under the\n" + "cursor or touchpoint when pressed remains under that point.") + disabledState: !backendValues.synchronousDrag.isAvailable } SecondColumnLayout { @@ -178,6 +191,7 @@ Section { Layout.fillWidth: true backendValue: backendValues.synchronousDrag text: backendValues.synchronousDrag.valueToString + enabled: backendValue.isAvailable } ExpandingSpacer { } @@ -265,12 +279,15 @@ Section { Label { text: qsTr("Origin") + disabledState: (!backendValues.originX.isAvailable + && !backendValues.originY.isAvailable) } SecondColumnLayout { Label { text: "X" width: root.labelWidth + disabledState: !backendValues.originX.isAvailable } SpinBox { @@ -279,6 +296,7 @@ Section { maximumValue: 8000 implicitWidth: root.spinBoxWidth Layout.fillWidth: true + enabled: backendValue.isAvailable } Item { @@ -289,6 +307,7 @@ Section { Label { text: "Y" width: root.labelWidth + disabledState: !backendValues.originY.isAvailable } SpinBox { @@ -297,6 +316,7 @@ Section { maximumValue: 8000 implicitWidth: root.spinBoxWidth Layout.fillWidth: true + enabled: backendValue.isAvailable } ExpandingSpacer { } @@ -304,6 +324,10 @@ Section { Label { text: qsTr("Margins") + disabledState: (!backendValues.topMargin.isAvailable + && !backendValues.bottomMargin.isAvailable + && !backendValues.leftMargin.isAvailable + && !backendValues.rightMargin.isAvailable) } SecondColumnLayout { @@ -312,6 +336,7 @@ Section { Label { text: "Top" width: root.labelWidth + disabledState: !backendValues.topMargin.isAvailable } SpinBox { @@ -321,6 +346,7 @@ Section { decimals: 0 implicitWidth: root.spinBoxWidth Layout.fillWidth: true + enabled: backendValue.isAvailable } Item { @@ -331,6 +357,7 @@ Section { Label { text: "Bottom" width: root.labelWidth + disabledState: !backendValues.bottomMargin.isAvailable } SpinBox { @@ -340,6 +367,7 @@ Section { decimals: 0 implicitWidth: root.spinBoxWidth Layout.fillWidth: true + enabled: backendValue.isAvailable } ExpandingSpacer { } @@ -355,6 +383,7 @@ Section { Label { text: "Left" width: root.labelWidth + disabledState: !backendValues.leftMargin.isAvailable } SpinBox { @@ -364,6 +393,7 @@ Section { decimals: 0 implicitWidth: root.spinBoxWidth Layout.fillWidth: true + enabled: backendValue.isAvailable } Item { @@ -374,6 +404,7 @@ Section { Label { text: "Right" width: root.labelWidth + disabledState: !backendValues.rightMargin.isAvailable } SpinBox { @@ -383,6 +414,7 @@ Section { decimals: 0 implicitWidth: root.spinBoxWidth Layout.fillWidth: true + enabled: backendValue.isAvailable } ExpandingSpacer { } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml index 1261f2ee5e..70bb856123 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml @@ -153,12 +153,13 @@ Section { italic: fontSection.italicStyle underline: fontSection.underlineStyle strikeout: fontSection.strikeoutStyle - enabled: !styleComboBox.styleSet + enabled: !styleNameComboBox.styleSet } Label { text: qsTr("Font capitalization") toolTip: qsTr("Sets the capitalization for the text.") + disabledState: !getBackendValue("capitalization").isAvailable } ComboBox { @@ -166,6 +167,7 @@ Section { backendValue: getBackendValue("capitalization") model: ["MixedCase", "AllUppercase", "AllLowercase", "SmallCaps", "Capitalize"] scope: "Font" + enabled: backendValue.isAvailable } Label { @@ -178,38 +180,45 @@ Section { backendValue: getBackendValue("weight") model: ["Normal", "Light", "ExtraLight", "Thin", "Medium", "DemiBold", "Bold", "ExtraBold", "Black"] scope: "Font" - enabled: !styleComboBox.styleSet + enabled: !styleNameComboBox.styleSet } Label { text: qsTr("Style name") toolTip: qsTr("Sets the font's style.") + disabledState: !styleNameComboBox.enabled } ComboBox { - id: styleComboBox + id: styleNameComboBox property bool styleSet: backendValue.isInModel Layout.fillWidth: true backendValue: getBackendValue("styleName") model: styleNamesForFamily(fontComboBox.familyName) valueType: ComboBox.String + enabled: backendValue.isAvailable } Label { visible: showStyle text: qsTr("Style") + disabledState: !styleComboBox.enabled } ComboBox { + id: styleComboBox visible: showStyle Layout.fillWidth: true backendValue: (backendValues.style === undefined) ? dummyBackendValue : backendValues.style model: ["Normal", "Outline", "Raised", "Sunken"] scope: "Text" + enabled: backendValue.isAvailable } Label { text: qsTr("Spacing") + disabledState: (!getBackendValue("wordSpacing").isAvailable && + !getBackendValue("letterSpacing").isAvailable) } SecondColumnLayout { @@ -222,18 +231,19 @@ Section { Layout.fillWidth: true Layout.minimumWidth: 60 stepSize: 0.1 + enabled: backendValue.isAvailable } Label { text: qsTr("Word") tooltip: qsTr("Sets the word spacing for the font.") width: 42 + disabledState: !getBackendValue("wordSpacing").isAvailable } Item { width: 4 height: 4 } - SpinBox { maximumValue: 500 minimumValue: -500 @@ -242,17 +252,21 @@ Section { Layout.fillWidth: true Layout.minimumWidth: 60 stepSize: 0.1 + enabled: backendValue.isAvailable } Label { text: qsTr("Letter") tooltip: qsTr("Sets the letter spacing for the font.") width: 42 + disabledState: !getBackendValue("letterSpacing").isAvailable } } Label { visible: minorQtQuickVersion > 9 text: qsTr("Performance") + disabledState: (!getBackendValue("kerning").isAvailable && + !getBackendValue("preferShaping").isAvailable) } SecondColumnLayout { @@ -264,6 +278,7 @@ Section { backendValue: getBackendValue("kerning") tooltip: qsTr("Enables or disables the kerning OpenType feature when shaping the text. Disabling this may " + "improve performance when creating or changing the text, at the expense of some cosmetic features. The default value is true.") + enabled: backendValue.isAvailable } CheckBox { @@ -273,12 +288,14 @@ Section { tooltip: qsTr("Sometimes, a font will apply complex rules to a set of characters in order to display them correctly.\n" + "In some writing systems, such as Brahmic scripts, this is required in order for the text to be legible, whereas in " + "Latin script,\n it is merely a cosmetic feature. Setting the preferShaping property to false will disable all such features\nwhen they are not required, which will improve performance in most cases.") + enabled: backendValue.isAvailable } } Label { text: qsTr("Hinting preference") toolTip: qsTr("Sets the preferred hinting on the text.") + disabledState: !getBackendValue("hintingPreference").isAvailable } ComboBox { @@ -286,6 +303,7 @@ Section { backendValue: getBackendValue("hintingPreference") model: ["PreferDefaultHinting", "PreferNoHinting", "PreferVerticalHinting", "PreferFullHinting"] scope: "Font" + enabled: backendValue.isAvailable } } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontStyleButtons.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontStyleButtons.qml index ff06c1e1bd..29803aa966 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontStyleButtons.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontStyleButtons.qml @@ -37,6 +37,7 @@ ButtonRow { BoolButtonRowButton { buttonIcon: StudioTheme.Constants.fontStyleBold backendValue: bold + enabled: backendValue.isAvailable } Item { width: 4 @@ -45,6 +46,7 @@ ButtonRow { BoolButtonRowButton { buttonIcon: StudioTheme.Constants.fontStyleItalic backendValue: italic + enabled: backendValue.isAvailable } Item { width: 4 @@ -53,6 +55,7 @@ ButtonRow { BoolButtonRowButton { buttonIcon: StudioTheme.Constants.fontStyleUnderline backendValue: underline + enabled: backendValue.isAvailable } Item { width: 4 @@ -61,5 +64,6 @@ ButtonRow { BoolButtonRowButton { buttonIcon: StudioTheme.Constants.fontStyleStrikethrough backendValue: strikeout + enabled: backendValue.isAvailable } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml index 6132cfd261..f7cf3be4ab 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml @@ -76,6 +76,7 @@ Section { Label { visible: showVerticalAlignment text: qsTr("Wrap mode") + disabledState: !backendValues.wrapMode.isAvailable } ComboBox { @@ -84,11 +85,13 @@ Section { backendValue: backendValues.wrapMode scope: "Text" model: ["NoWrap", "WordWrap", "WrapAnywhere", "Wrap"] + enabled: backendValue.isAvailable } Label { visible: showElide text: qsTr("Elide") + disabledState: !backendValues.elide.isAvailable } ComboBox { @@ -97,12 +100,14 @@ Section { backendValue: backendValues.elide scope: "Text" model: ["ElideNone", "ElideLeft", "ElideMiddle", "ElideRight"] + enabled: backendValue.isAvailable } Label { visible: showElide text: qsTr("Maximum line count") tooltip: qsTr("Limits the number of lines that the text item will show.") + disabledState: !backendValues.maximumLineCount.isAvailable } SpinBox { @@ -112,6 +117,7 @@ Section { minimumValue: 0 maximumValue: 10000 decimals: 0 + enabled: backendValue.isAvailable } Label { @@ -135,6 +141,7 @@ Section { Label { visible: showFormatProperty text: qsTr("Format") + disabledState: !backendValues.textFormat.isAvailable } ComboBox { scope: "Text" @@ -142,23 +149,27 @@ Section { model: ["PlainText", "RichText", "AutoText"] backendValue: backendValues.textFormat Layout.fillWidth: true + enabled: backendValue.isAvailable } Label { text: qsTr("Render type") toolTip: qsTr("Override the default rendering type for this item.") + disabledState: !backendValues.renderType.isAvailable } ComboBox { scope: "Text" model: ["QtRendering", "NativeRendering"] backendValue: backendValues.renderType Layout.fillWidth: true + enabled: backendValue.isAvailable } Label { visible: showFontSizeMode text: qsTr("Font size mode") toolTip: qsTr("Specifies how the font size of the displayed text is determined.") + disabledState: !backendValues.fontSizeMode.isAvailable } ComboBox { id: fontSizeMode @@ -167,17 +178,20 @@ Section { model: ["FixedSize", "HorizontalFit", "VerticalFit", "Fit"] backendValue: backendValues.fontSizeMode Layout.fillWidth: true + enabled: backendValue.isAvailable } Label { visible: showFontSizeMode text: qsTr("Minimum size") + disabledState: !backendValues.minimumPixelSize.isAvailable + && !backendValues.minimumPointSize.isAvailable } SecondColumnLayout { visible: showFontSizeMode SpinBox { - enabled: fontSizeMode.currentIndex !== 0 + enabled: (fontSizeMode.currentIndex !== 0) || backendValue.isAvailable minimumValue: 0 maximumValue: 500 decimals: 0 @@ -189,6 +203,7 @@ Section { text: qsTr("Pixel") tooltip: qsTr("Specifies the minimum font pixel size of scaled text.") width: 42 + disabledState: !backendValues.minimumPixelSize.isAvailable } Item { @@ -197,7 +212,7 @@ Section { } SpinBox { - enabled: fontSizeMode.currentIndex !== 0 + enabled: (fontSizeMode.currentIndex !== 0) || backendValue.isAvailable minimumValue: 0 maximumValue: 500 decimals: 0 @@ -209,6 +224,7 @@ Section { text: qsTr("Point") tooltip: qsTr("Specifies the minimum font point size of scaled text.") width: 42 + disabledState: !backendValues.minimumPointSize.isAvailable } } @@ -216,9 +232,11 @@ Section { visible: showLineHeight text: qsTr("Line height") tooltip: qsTr("Sets the line height for the text.") + disabledState: !lineHeightSpinBox.enabled } SpinBox { + id: lineHeightSpinBox visible: showLineHeight Layout.fillWidth: true backendValue: (backendValues.lineHeight === undefined) ? dummyBackendValue : backendValues.lineHeight @@ -226,12 +244,14 @@ Section { minimumValue: 0 decimals: 2 stepSize: 0.1 + enabled: backendValue.isAvailable } Label { visible: showLineHeight text: qsTr("Line height mode") toolTip: qsTr("Determines how the line height is specified.") + disabledState: !backendValues.lineHeightMode.isAvailable } ComboBox { visible: showLineHeight @@ -239,6 +259,7 @@ Section { model: ["ProportionalHeight", "FixedHeight"] backendValue: backendValues.lineHeightMode Layout.fillWidth: true + enabled: backendValue.isAvailable } } |