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

View File

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

View File

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

View File

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

View File

@@ -289,12 +289,22 @@ static QList<QByteArray> prepareNonMcuProperties()
const QList<QByteArray> textProperties = {"elide", "lineHeight", "lineHeightMode", "wrapMode", "style",
"styleColor", "minimumPointSize", "minimumPixelSize", "styleColor",
"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(mouseAreaProperties);
result.append(flickableProperties);
result.append(imageProperties);
result.append(textProperties);
result.append(paddingProperties);
result.append(columnRowProperties);
result.append(listViewProperties);
return result;
}