QmlDesigner: Disable more properties for QUL

Disabling more items in ItemLibrary and properties

Change-Id: Ib019c1cbe356e0f7e3889d3500c080b0f5756c34
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Aleksei German
2020-09-02 18:34:22 +02:00
committed by Thomas Hartmann
parent fd32b222ee
commit b11bfd5652
5 changed files with 66 additions and 7 deletions

View File

@@ -46,6 +46,7 @@ Column {
Label { Label {
text: qsTr("Cache") text: qsTr("Cache")
tooltip: qsTr("Cache buffer") tooltip: qsTr("Cache buffer")
disabledState: !backendValues.cacheBuffer.isAvailable
} }
SectionLayout { SectionLayout {
@@ -54,6 +55,7 @@ Column {
minimumValue: 0 minimumValue: 0
maximumValue: 1000 maximumValue: 1000
decimals: 0 decimals: 0
enabled: backendValue.isAvailable
} }
ExpandingSpacer { ExpandingSpacer {
@@ -63,6 +65,7 @@ Column {
Label { Label {
text: qsTr("Navigation wraps") text: qsTr("Navigation wraps")
tooltip: qsTr("Determines whether the grid wraps key navigation.") tooltip: qsTr("Determines whether the grid wraps key navigation.")
disabledState: !backendValues.keyNavigationWraps.isAvailable
} }
SectionLayout { SectionLayout {
@@ -70,6 +73,7 @@ Column {
Layout.fillWidth: true Layout.fillWidth: true
backendValue: backendValues.keyNavigationWraps backendValue: backendValues.keyNavigationWraps
text: backendValues.keyNavigationWraps.valueToString text: backendValues.keyNavigationWraps.valueToString
enabled: backendValue.isAvailable
} }
ExpandingSpacer { ExpandingSpacer {
} }
@@ -93,6 +97,7 @@ Column {
Label { Label {
text: qsTr("Layout Direction") text: qsTr("Layout Direction")
disabledState: !backendValues.layoutDirection.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -101,6 +106,7 @@ Column {
model: ["LeftToRight", "RightToLeft"] model: ["LeftToRight", "RightToLeft"]
backendValue: backendValues.layoutDirection backendValue: backendValues.layoutDirection
Layout.fillWidth: true Layout.fillWidth: true
enabled: backendValue.isAvailable
} }
ExpandingSpacer { ExpandingSpacer {
} }
@@ -109,6 +115,7 @@ Column {
Label { Label {
text: qsTr("Snap mode") text: qsTr("Snap mode")
tooltip: qsTr("Determines how the view scrolling will settle following a drag or flick.") tooltip: qsTr("Determines how the view scrolling will settle following a drag or flick.")
disabledState: !backendValues.snapMode.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -117,6 +124,7 @@ Column {
model: ["NoSnap", "SnapToItem", "SnapOneItem"] model: ["NoSnap", "SnapToItem", "SnapOneItem"]
backendValue: backendValues.snapMode backendValue: backendValues.snapMode
Layout.fillWidth: true Layout.fillWidth: true
enabled: backendValue.isAvailable
} }
ExpandingSpacer { ExpandingSpacer {
} }
@@ -151,6 +159,7 @@ Column {
Label { Label {
text: qsTr("Range") text: qsTr("Range")
tooltip: qsTr("Highlight range") tooltip: qsTr("Highlight range")
disabledState: !backendValues.highlightRangeMode.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -159,6 +168,7 @@ Column {
model: ["NoHighlightRange", "ApplyRange", "StrictlyEnforceRange"] model: ["NoHighlightRange", "ApplyRange", "StrictlyEnforceRange"]
backendValue: backendValues.highlightRangeMode backendValue: backendValues.highlightRangeMode
Layout.fillWidth: true Layout.fillWidth: true
enabled: backendValue.isAvailable
} }
ExpandingSpacer { ExpandingSpacer {
} }
@@ -168,6 +178,7 @@ Column {
Label { Label {
text: qsTr("Move duration") text: qsTr("Move duration")
tooltip: qsTr("Move animation duration of the highlight delegate.") tooltip: qsTr("Move animation duration of the highlight delegate.")
disabledState: !backendValues.highlightMoveDuration.isAvailable
} }
SectionLayout { SectionLayout {
@@ -176,6 +187,7 @@ Column {
minimumValue: -1 minimumValue: -1
maximumValue: 1000 maximumValue: 1000
decimals: 0 decimals: 0
enabled: backendValue.isAvailable
} }
ExpandingSpacer { ExpandingSpacer {
} }
@@ -184,6 +196,7 @@ Column {
Label { Label {
text: qsTr("Move velocity") text: qsTr("Move velocity")
tooltip: qsTr("Move animation velocity of the highlight delegate.") tooltip: qsTr("Move animation velocity of the highlight delegate.")
disabledState: !backendValues.highlightMoveVelocity.isAvailable
} }
SectionLayout { SectionLayout {
@@ -192,6 +205,7 @@ Column {
minimumValue: -1 minimumValue: -1
maximumValue: 1000 maximumValue: 1000
decimals: 0 decimals: 0
enabled: backendValue.isAvailable
} }
ExpandingSpacer { ExpandingSpacer {
} }
@@ -200,6 +214,7 @@ Column {
Label { Label {
text: qsTr("Resize duration") text: qsTr("Resize duration")
tooltip: qsTr("Resize animation duration of the highlight delegate.") tooltip: qsTr("Resize animation duration of the highlight delegate.")
disabledState: !backendValues.highlightResizeDuration.isAvailable
} }
SectionLayout { SectionLayout {
@@ -208,6 +223,7 @@ Column {
minimumValue: -1 minimumValue: -1
maximumValue: 1000 maximumValue: 1000
decimals: 0 decimals: 0
enabled: backendValue.isAvailable
} }
ExpandingSpacer { ExpandingSpacer {
} }
@@ -216,6 +232,7 @@ Column {
Label { Label {
text: qsTr("Resize velocity") text: qsTr("Resize velocity")
tooltip: qsTr("Resize animation velocity of the highlight delegate.") tooltip: qsTr("Resize animation velocity of the highlight delegate.")
disabledState: !backendValues.highlightResizeVelocity.isAvailable
} }
SectionLayout { SectionLayout {
@@ -224,6 +241,7 @@ Column {
minimumValue: -1 minimumValue: -1
maximumValue: 1000 maximumValue: 1000
decimals: 0 decimals: 0
enabled: backendValue.isAvailable
} }
ExpandingSpacer { ExpandingSpacer {
} }
@@ -232,6 +250,7 @@ Column {
Label { Label {
text: qsTr("Preferred begin") text: qsTr("Preferred begin")
tooltip: qsTr("Preferred highlight begin - must be smaller than Preferred end.") tooltip: qsTr("Preferred highlight begin - must be smaller than Preferred end.")
disabledState: !backendValues.preferredHighlightBegin.isAvailable
} }
SectionLayout { SectionLayout {
@@ -240,6 +259,7 @@ Column {
minimumValue: 0 minimumValue: 0
maximumValue: 1000 maximumValue: 1000
decimals: 0 decimals: 0
enabled: backendValue.isAvailable
} }
ExpandingSpacer { ExpandingSpacer {
} }
@@ -248,6 +268,7 @@ Column {
Label { Label {
text: qsTr("Preferred end") text: qsTr("Preferred end")
tooltip: qsTr("Preferred highlight end - must be larger than Preferred begin.") tooltip: qsTr("Preferred highlight end - must be larger than Preferred begin.")
disabledState: !backendValues.preferredHighlightEnd.isAvailable
} }
SectionLayout { SectionLayout {
@@ -256,6 +277,7 @@ Column {
minimumValue: 0 minimumValue: 0
maximumValue: 1000 maximumValue: 1000
decimals: 0 decimals: 0
enabled: backendValue.isAvailable
} }
ExpandingSpacer { ExpandingSpacer {
} }
@@ -264,6 +286,7 @@ Column {
Label { Label {
text: qsTr("Follows current") text: qsTr("Follows current")
tooltip: qsTr("Determines whether the highlight is managed by the view.") tooltip: qsTr("Determines whether the highlight is managed by the view.")
disabledState: !backendValues.highlightFollowsCurrentItem.isAvailable
} }
SectionLayout { SectionLayout {
@@ -271,6 +294,7 @@ Column {
Layout.fillWidth: true Layout.fillWidth: true
backendValue: backendValues.highlightFollowsCurrentItem backendValue: backendValues.highlightFollowsCurrentItem
text: backendValues.highlightFollowsCurrentItem.valueToString text: backendValues.highlightFollowsCurrentItem.valueToString
enabled: backendValue.isAvailable
} }
ExpandingSpacer { ExpandingSpacer {
} }

View File

@@ -39,6 +39,7 @@ Column {
SectionLayout { SectionLayout {
Label { Label {
text: qsTr("Layout Direction") text: qsTr("Layout Direction")
disabledState: !backendValues.layoutDirection.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -47,6 +48,7 @@ Column {
backendValue: backendValues.layoutDirection backendValue: backendValues.layoutDirection
Layout.fillWidth: true Layout.fillWidth: true
scope: "Qt" scope: "Qt"
enabled: backendValue.isAvailable
} }
} }

View File

@@ -36,12 +36,14 @@ Section {
SectionLayout { SectionLayout {
Label { Label {
text: qsTr("Vertical") text: qsTr("Vertical")
disabledState: (!backendValues.topPadding.isAvailable && !backendValues.bottomPadding.isAvailable)
} }
SecondColumnLayout { SecondColumnLayout {
Label { Label {
text: qsTr("Top") text: qsTr("Top")
tooltip: qsTr("Padding between the content and the top edge of the item.") tooltip: qsTr("Padding between the content and the top edge of the item.")
width: 42 width: 42
disabledStateSoft: !backendValues.topPadding.isAvailable
} }
SpinBox { SpinBox {
maximumValue: 10000 maximumValue: 10000
@@ -50,6 +52,7 @@ Section {
decimals: 0 decimals: 0
backendValue: backendValues.topPadding backendValue: backendValues.topPadding
Layout.fillWidth: true Layout.fillWidth: true
enabled: backendValue.isAvailable
} }
Item { Item {
width: 4 width: 4
@@ -60,6 +63,7 @@ Section {
text: qsTr("Bottom") text: qsTr("Bottom")
tooltip: qsTr("Padding between the content and the bottom edge of the item.") tooltip: qsTr("Padding between the content and the bottom edge of the item.")
width: 42 width: 42
disabledStateSoft: !backendValues.bottomPadding.isAvailable
} }
SpinBox { SpinBox {
maximumValue: 10000 maximumValue: 10000
@@ -68,17 +72,20 @@ Section {
decimals: 0 decimals: 0
backendValue: backendValues.bottomPadding backendValue: backendValues.bottomPadding
Layout.fillWidth: true Layout.fillWidth: true
enabled: backendValue.isAvailable
} }
} }
Label { Label {
text: qsTr("Horizontal") text: qsTr("Horizontal")
disabledState: (!backendValues.leftPadding.isAvailable && !backendValues.rightPadding.isAvailable)
} }
SecondColumnLayout { SecondColumnLayout {
Label { Label {
text: qsTr("Left") text: qsTr("Left")
tooltip: qsTr("Padding between the content and the left edge of the item.") tooltip: qsTr("Padding between the content and the left edge of the item.")
width: 42 width: 42
disabledStateSoft: !backendValues.leftPadding.isAvailable
} }
SpinBox { SpinBox {
maximumValue: 10000 maximumValue: 10000
@@ -87,6 +94,7 @@ Section {
decimals: 0 decimals: 0
backendValue: backendValues.leftPadding backendValue: backendValues.leftPadding
Layout.fillWidth: true Layout.fillWidth: true
enabled: backendValue.isAvailable
} }
Item { Item {
width: 4 width: 4
@@ -97,6 +105,7 @@ Section {
text: qsTr("Right") text: qsTr("Right")
tooltip: qsTr("Padding between the content and the right edge of the item.") tooltip: qsTr("Padding between the content and the right edge of the item.")
width: 42 width: 42
disabledStateSoft: !backendValues.rightPadding.isAvailable
} }
SpinBox { SpinBox {
maximumValue: 10000 maximumValue: 10000
@@ -105,12 +114,14 @@ Section {
decimals: 0 decimals: 0
backendValue: backendValues.rightPadding backendValue: backendValues.rightPadding
Layout.fillWidth: true Layout.fillWidth: true
enabled: backendValue.isAvailable
} }
} }
Label { Label {
text: qsTr("Padding") text: qsTr("Padding")
tooltip: qsTr("Padding between the content and the edges of the items.") tooltip: qsTr("Padding between the content and the edges of the items.")
disabledState: !backendValues.padding.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
SpinBox { SpinBox {
@@ -120,6 +131,7 @@ Section {
decimals: 0 decimals: 0
backendValue: backendValues.padding backendValue: backendValues.padding
Layout.fillWidth: true Layout.fillWidth: true
enabled: backendValue.isAvailable
} }
} }
} }

View File

@@ -213,26 +213,37 @@ void ItemLibraryModel::update(ItemLibraryInfo *itemLibraryInfo, Model *model)
"QtQuick.Flow", "QtQuick.Flow",
"QtQuick.Grid", "QtQuick.Grid",
"QtQuick.GridView", "QtQuick.GridView",
"QtQuick.Controls.ButtonGroup", "QtQuick.PathView",
"QtQuick.Controls", "QtQuick.Controls",
"QtQuick.Controls.BusyIndicator",
"QtQuick.Controls.ButtonGroup",
"QtQuick.Controls.CheckDelegate",
"QtQuick.Controls.Container", "QtQuick.Controls.Container",
"QtQuick.Controls.DelayButton",
"QtQuick.Controls.ComboBox", "QtQuick.Controls.ComboBox",
"QtQuick.Controls.DelayButton",
"QtQuick.Controls.Frame", "QtQuick.Controls.Frame",
"QtQuick.Controls.GroupBox", "QtQuick.Controls.GroupBox",
"QtQuick.Controls.ItemDelegate", "QtQuick.Controls.ItemDelegate",
"QtQuick.Controls.SpinBox", "QtQuick.Controls.Label",
"QtQuick.Controls.Page",
"QtQuick.Controls.PageIndicator",
"QtQuick.Controls.Pane",
"QtQuick.Controls.RadioDelegate", "QtQuick.Controls.RadioDelegate",
"QtQuick.Controls.RangeSlider",
"QtQuick.Controls.RoundButton", "QtQuick.Controls.RoundButton",
"QtQuick.Controls.ScrollView", "QtQuick.Controls.ScrollView",
"QtQuick.Controls.RangeSlider", "QtQuick.Controls.SpinBox",
"QtQuick.Controls.StackView",
"QtQuick.Controls.SwipeDelegate",
"QtQuick.Controls.SwitchDelegate",
"QtQuick.Controls.ToolBar", "QtQuick.Controls.ToolBar",
"QtQuick.Controls.TooButton", "QtQuick.Controls.ToolButton",
"QtQuick.Controls.TabBar", "QtQuick.Controls.TabBar",
"QtQuick.Controls.TabButton", "QtQuick.Controls.TabButton",
"QtQuick.Controls.SwitchDelegate",
"QtQuick.Controls.TextArea", "QtQuick.Controls.TextArea",
"QtQuick.Controls.TextField"}; "QtQuick.Controls.TextField",
"QtQuick.Controls.ToolSeparator",
"QtQuick.Controls.Tumbler"};
if (blockTypes.contains(entry.typeName())) if (blockTypes.contains(entry.typeName()))
valid = false; valid = false;

View File

@@ -289,12 +289,22 @@ static QList<QByteArray> prepareNonMcuProperties()
const QList<QByteArray> textProperties = {"elide", "lineHeight", "lineHeightMode", "wrapMode", "style", const QList<QByteArray> textProperties = {"elide", "lineHeight", "lineHeightMode", "wrapMode", "style",
"styleColor", "minimumPointSize", "minimumPixelSize", "styleColor", "styleColor", "minimumPointSize", "minimumPixelSize", "styleColor",
"fontSizeMode", "renderType", "textFormat", "maximumLineCount"}; "fontSizeMode", "renderType", "textFormat", "maximumLineCount"};
const QList<QByteArray> paddingProperties = {"bottomPadding", "topPadding", "leftPadding", "rightPadding"};
const QList<QByteArray> columnRowProperties = {"layoutDirection"};
const QList<QByteArray> listViewProperties = {"cacheBuffer", "highlightRangeMode", "highlightMoveDuration",
"highlightResizeDuration", "preferredHighlightBegin", "layoutDirection",
"preferredHighlightEnd", "highlightFollowsCurrentItem", "keyNavigationWraps",
"snapMode", "highlightMoveVelocity", "highlightResizeVelocity"};
result.append(itemProperties); result.append(itemProperties);
result.append(mouseAreaProperties); result.append(mouseAreaProperties);
result.append(flickableProperties); result.append(flickableProperties);
result.append(imageProperties); result.append(imageProperties);
result.append(textProperties); result.append(textProperties);
result.append(paddingProperties);
result.append(columnRowProperties);
result.append(listViewProperties);
return result; return result;
} }