aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorLukasz Ornatek <lukasz.ornatek@qt.io>2020-07-20 12:09:18 +0200
committerƁukasz Ornatek <lukasz.ornatek@qt.io>2020-07-21 16:23:09 +0000
commita7c14b54931c3efa4cac255670f9fc9528891e0b (patch)
tree5fd869fa7a568b1d26023fcefb45d93fc3bac88d /share
parentce926844d0a5b64abca2f4fd172f8c84aa9ccd54 (diff)
Support multiline text
Use rich text editor widget as dialog for multiline text input Change-Id: I13147e776867032fe1145d6a8a37fcd6976399e4 Task-number: QDS-2229 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Diffstat (limited to 'share')
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml62
1 files changed, 59 insertions, 3 deletions
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml
index 6c5e6fde86..777fb0adc4 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml
@@ -26,6 +26,8 @@
import QtQuick 2.1
import HelperWidgets 2.0
import QtQuick.Layouts 1.0
+import StudioControls 1.0 as StudioControls
+import StudioTheme 1.0 as StudioTheme
Section {
anchors.left: parent.left
@@ -46,9 +48,29 @@ Section {
Label {
text: qsTr("Text")
}
- LineEdit {
- backendValue: backendValues.text
- Layout.fillWidth: true
+
+ RowLayout {
+ LineEdit {
+ backendValue: backendValues.text
+ Layout.fillWidth: true
+ }
+
+ StudioControls.AbstractButton {
+ id: richTextEditorButton
+ buttonIcon: StudioTheme.Constants.textAlignTop
+ onClicked: {
+ richTextDialogLoader.show()
+ }
+ }
+
+ RichTextEditor{
+ onRejected: {
+ hideWidget()
+ }
+ onAccepted: {
+ hideWidget()
+ }
+ }
}
Label {
@@ -219,4 +241,38 @@ Section {
Layout.fillWidth: true
}
}
+
+ Loader {
+ id: richTextDialogLoader
+
+ visible: false
+ active: visible
+
+ function show() {
+ richTextDialogLoader.visible = true
+ }
+
+ sourceComponent: Item {
+ id: richTextEditorParent
+
+ Component.onCompleted: {
+ richTextEditor.showWidget()
+ richTextEditor.richText = backendValues.text.value
+ }
+
+ RichTextEditor {
+ id: richTextEditor
+
+ onRejected: {
+ hideWidget()
+ richTextDialogLoader.visible = false
+ }
+ onAccepted: {
+ backendValues.text.value = richTextEditor.richText
+ hideWidget()
+ richTextDialogLoader.visible = false
+ }
+ }
+ }
+ }
}