From 094379e2cee537faba553889c555a3c25fe71cdd Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Wed, 11 Dec 2024 17:10:28 +0100 Subject: [PATCH] QmlDesigner: Fix device manager table text edit Fix device manager table text edit by using QtQuick.Templates instead of QtQuick default style. Otherwise this will cause issues under windows. Task-number: QDS-14270 Change-Id: I4ecc90fd7a581211818ed1f7d5058ca24f5625aa Reviewed-by: Thomas Hartmann Reviewed-by: Burak Hancerli --- .../qmldesigner/devicemanager/Main.qml | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/share/qtcreator/qmldesigner/devicemanager/Main.qml b/share/qtcreator/qmldesigner/devicemanager/Main.qml index c405ed4924e..06f1647dcd6 100644 --- a/share/qtcreator/qmldesigner/devicemanager/Main.qml +++ b/share/qtcreator/qmldesigner/devicemanager/Main.qml @@ -31,7 +31,8 @@ Rectangle { required property bool selected required property bool current - color: tableView.currentRow === row ? StudioTheme.Values.themeTableCellCurrent : StudioTheme.Values.themePanelBackground + color: tableView.currentRow === row ? StudioTheme.Values.themeTableCellCurrent + : StudioTheme.Values.themePanelBackground implicitWidth: StudioTheme.Values.cellWidth implicitHeight: StudioTheme.Values.cellHeight border { @@ -54,7 +55,7 @@ Rectangle { popup.y = rootRectangle.y + rootRectangle.height + popup.chevronSize.height popup.chevronPosition = Qt.point(rootRectangle.x - popup.x + rootRectangle.width / 2, - -popup.chevronSize.height) + -popup.chevronSize.height) } implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, @@ -68,7 +69,7 @@ Rectangle { padding: 20 modal: false focus: true - closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside + closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutside background: Rectangle { color: StudioTheme.Values.themePopupBackground @@ -170,12 +171,23 @@ Rectangle { verticalAlignment: Qt.AlignVCenter } - TableView.editDelegate: TextField { + TableView.editDelegate: T.TextField { + id: textField + + property StudioTheme.ControlStyle style: StudioTheme.Values.controlStyle + anchors.fill: parent text: aliasDelegate.display horizontalAlignment: TextInput.AlignLeft verticalAlignment: TextInput.AlignVCenter padding: 8 + + font.pixelSize: textField.style.baseFontSize + color: textField.style.text.idle + selectionColor: textField.style.text.selection + selectedTextColor: textField.style.text.selectedText + placeholderTextColor: textField.style.text.placeholder + Component.onCompleted: selectAll() TableView.onCommit: {