aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Gruendl <henning.gruendl@qt.io>2023-09-19 13:46:53 +0200
committerHenning Gründl <henning.gruendl@qt.io>2023-09-20 07:44:30 +0000
commit04c9a5bc3f218413acb10c88828afc85699db01c (patch)
treef40fe3c4b5016623c31663fb9246b90d1ac4bc88
parent97fde8bc1fbd647af360b16abaccdb3655964c17 (diff)
QmlDesigner: Add tooltip on elided pills
Change-Id: I4a40070b958a46e46009ba8f141fd5c286858ab7 Reviewed-by: Brook Cronin <brook.cronin@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> (cherry picked from commit 109ed4f99c6b7da25d21aae5cf4aeb95e41779ab)
-rw-r--r--share/qtcreator/qmldesigner/connectionseditor/Pill.qml16
1 files changed, 15 insertions, 1 deletions
diff --git a/share/qtcreator/qmldesigner/connectionseditor/Pill.qml b/share/qtcreator/qmldesigner/connectionseditor/Pill.qml
index d92163e909..aa6cba0363 100644
--- a/share/qtcreator/qmldesigner/connectionseditor/Pill.qml
+++ b/share/qtcreator/qmldesigner/connectionseditor/Pill.qml
@@ -4,6 +4,7 @@
import QtQuick
import StudioControls as StudioControls
import StudioTheme as StudioTheme
+import HelperWidgets as HelperWidgets
FocusScope {
id: root
@@ -54,12 +55,25 @@ FocusScope {
root.remove()
}
- MouseArea {
+ HelperWidgets.ToolTipArea {
id: rootMouseArea
anchors.fill: parent
hoverEnabled: true
cursorShape: root.isEditable() ? Qt.IBeamCursor : Qt.ArrowCursor
onClicked: root.forceActiveFocus()
+ tooltip: {
+ if (textItem.visible) {
+ if (textItem.truncated)
+ return textItem.text
+ else
+ return ""
+ }
+
+ if (textMetrics.width > textInput.width)
+ return textInput.text
+
+ return ""
+ }
}
Rectangle {