QmlDesigner: Fix TextFieldSpecifics

Add TextInputSection to TextFieldSpecifics as TextField inherits from
TextInput. Align the properties of the contained sections to the ones in
TextInputSpecifics. Also adjust TextArea specifics to also contain
TextInputSection.

Task-number: QDS-9792
Change-Id: I3a4a734d965f3834ccd1e5cad23bb125b9ca592c
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Henning Gruendl
2023-04-27 14:01:38 +02:00
committed by Henning Gründl
parent 3ef30f57a2
commit 949c380018
4 changed files with 34 additions and 21 deletions

View File

@@ -16,6 +16,8 @@ Column {
showVerticalAlignment: true showVerticalAlignment: true
} }
TextInputSection {}
TextExtrasSection { TextExtrasSection {
showWrapMode: true showWrapMode: true
showFormatProperty: true showFormatProperty: true

View File

@@ -14,11 +14,21 @@ Column {
caption: qsTr("Text Field") caption: qsTr("Text Field")
} }
CharacterSection {} CharacterSection {
showVerticalAlignment: true
}
TextExtrasSection {} TextInputSection {
isTextInput: true
}
FontExtrasSection {} TextExtrasSection {
showWrapMode: true
}
FontExtrasSection {
showStyle: false
}
PaddingSection {} PaddingSection {}

View File

@@ -7,7 +7,7 @@ import HelperWidgets 2.0
import StudioTheme 1.0 as StudioTheme import StudioTheme 1.0 as StudioTheme
Section { Section {
id: textInputSection id: root
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
caption: qsTr("Text Input") caption: qsTr("Text Input")
@@ -46,7 +46,7 @@ Section {
+ StudioTheme.Values.actionIndicatorWidth + StudioTheme.Values.actionIndicatorWidth
width: implicitWidth width: implicitWidth
backendValue: backendValues.mouseSelectionMode backendValue: backendValues.mouseSelectionMode
scope: "TextInput" scope: root.isTextInput ? "TextInput" : "TextEdit"
model: ["SelectCharacters", "SelectWords"] model: ["SelectCharacters", "SelectWords"]
} }
@@ -54,13 +54,13 @@ Section {
} }
PropertyLabel { PropertyLabel {
visible: textInputSection.isTextInput visible: root.isTextInput
text: qsTr("Input mask") text: qsTr("Input mask")
tooltip: qsTr("Sets the allowed characters.") tooltip: qsTr("Sets the allowed characters.")
} }
SecondColumnLayout { SecondColumnLayout {
visible: textInputSection.isTextInput visible: root.isTextInput
LineEdit { LineEdit {
backendValue: backendValues.inputMask backendValue: backendValues.inputMask
@@ -74,13 +74,13 @@ Section {
} }
PropertyLabel { PropertyLabel {
visible: textInputSection.isTextInput visible: root.isTextInput
text: qsTr("Echo mode") text: qsTr("Echo mode")
tooltip: qsTr("Sets the visibility mode.") tooltip: qsTr("Sets the visibility mode.")
} }
SecondColumnLayout { SecondColumnLayout {
visible: textInputSection.isTextInput visible: root.isTextInput
ComboBox { ComboBox {
implicitWidth: StudioTheme.Values.singleControlColumnWidth implicitWidth: StudioTheme.Values.singleControlColumnWidth
@@ -95,13 +95,13 @@ Section {
} }
PropertyLabel { PropertyLabel {
visible: textInputSection.isTextInput visible: root.isTextInput
text: qsTr("Password character") text: qsTr("Password character")
tooltip: qsTr("Sets which character to display when passwords are entered.") tooltip: qsTr("Sets which character to display when passwords are entered.")
} }
SecondColumnLayout { SecondColumnLayout {
visible: textInputSection.isTextInput visible: root.isTextInput
LineEdit { LineEdit {
backendValue: backendValues.passwordCharacter backendValue: backendValues.passwordCharacter
@@ -115,13 +115,13 @@ Section {
} }
PropertyLabel { PropertyLabel {
visible: !textInputSection.isTextInput visible: !root.isTextInput
text: qsTr("Tab stop distance") text: qsTr("Tab stop distance")
tooltip: qsTr("Default distance between tab stops in device units.") tooltip: qsTr("Default distance between tab stops in device units.")
} }
SecondColumnLayout { SecondColumnLayout {
visible: !textInputSection.isTextInput visible: !root.isTextInput
SpinBox { SpinBox {
implicitWidth: StudioTheme.Values.twoControlColumnWidth implicitWidth: StudioTheme.Values.twoControlColumnWidth
@@ -139,13 +139,13 @@ Section {
} }
PropertyLabel { PropertyLabel {
visible: !textInputSection.isTextInput visible: !root.isTextInput
text: qsTr("Text margin") text: qsTr("Text margin")
tooltip: qsTr("Margin around the text in the Text Edit in pixels.") tooltip: qsTr("Margin around the text in the Text Edit in pixels.")
} }
SecondColumnLayout { SecondColumnLayout {
visible: !textInputSection.isTextInput visible: !root.isTextInput
SpinBox { SpinBox {
implicitWidth: StudioTheme.Values.twoControlColumnWidth implicitWidth: StudioTheme.Values.twoControlColumnWidth
@@ -163,13 +163,13 @@ Section {
} }
PropertyLabel { PropertyLabel {
visible: textInputSection.isTextInput visible: root.isTextInput
text: qsTr("Maximum length") text: qsTr("Maximum length")
tooltip: qsTr("Sets the maximum length of the text.") tooltip: qsTr("Sets the maximum length of the text.")
} }
SecondColumnLayout { SecondColumnLayout {
visible: textInputSection.isTextInput visible: root.isTextInput
SpinBox { SpinBox {
implicitWidth: StudioTheme.Values.singleControlColumnWidth implicitWidth: StudioTheme.Values.singleControlColumnWidth
@@ -216,13 +216,13 @@ Section {
FlagItem { backendValue: backendValues.activeFocusOnPress } FlagItem { backendValue: backendValues.activeFocusOnPress }
PropertyLabel { PropertyLabel {
visible: textInputSection.isTextInput visible: root.isTextInput
text: qsTr("Auto scroll") text: qsTr("Auto scroll")
tooltip: qsTr("Toggles if the text scrolls when it exceeds its boundary.") tooltip: qsTr("Toggles if the text scrolls when it exceeds its boundary.")
} }
FlagItem { FlagItem {
visible: textInputSection.isTextInput visible: root.isTextInput
backendValue: backendValues.autoScroll backendValue: backendValues.autoScroll
} }
@@ -248,12 +248,12 @@ Section {
FlagItem { backendValue: backendValues.selectByMouse } FlagItem { backendValue: backendValues.selectByMouse }
PropertyLabel { PropertyLabel {
visible: !textInputSection.isTextInput visible: !root.isTextInput
text: qsTr("Select by keyboard") text: qsTr("Select by keyboard")
} }
FlagItem { FlagItem {
visible: !textInputSection.isTextInput visible: !root.isTextInput
backendValue: backendValues.selectByKeyboard backendValue: backendValues.selectByKeyboard
} }
} }

View File

@@ -67,6 +67,7 @@ Spacer 2.0 Spacer.qml
SpinBox 2.0 SpinBox.qml SpinBox 2.0 SpinBox.qml
StandardTextSection 2.0 StandardTextSection.qml StandardTextSection 2.0 StandardTextSection.qml
TextExtrasSection 2.0 TextExtrasSection.qml TextExtrasSection 2.0 TextExtrasSection.qml
TextInputSection 2.0 TextInputSection.qml
ToolTipArea 2.0 ToolTipArea.qml ToolTipArea 2.0 ToolTipArea.qml
UrlChooser 2.0 UrlChooser.qml UrlChooser 2.0 UrlChooser.qml
VerticalScrollBar 2.0 VerticalScrollBar.qml VerticalScrollBar 2.0 VerticalScrollBar.qml