diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2023-02-24 07:08:02 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2023-02-25 08:13:47 +0000 |
commit | e83fda5af1e5681a9ca03ce9c31810731586dd21 (patch) | |
tree | 11970cf74e0e46bbdc4df70b053315ad62f5c5b9 | |
parent | 51e4ed51b10e568a6a09e771115ad149f6126ce2 (diff) | |
download | qtdoc-e83fda5af1e5681a9ca03ce9c31810731586dd21.tar.gz |
Replace ToolTip with margin text in photosurface demo
You might have to zoom in to read these labels, but they look more
physical, like the dates that some photo-processing services used to
print on the edges of film prints decades ago; and it avoids the
weirdness with ToolTip-attached orbiting the tooltip around while the
photo is rotated.
Task-number: QTBUG-111353
Change-Id: Ifa59c98ef05c28b57446a4212f6954a43ffc4e46
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 0391a2fb98f703c43a8aaaba5d817e2c34cf5a7b)
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r-- | examples/demos/photosurface/photosurface.qml | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/examples/demos/photosurface/photosurface.qml b/examples/demos/photosurface/photosurface.qml index a276ff29..606b9148 100644 --- a/examples/demos/photosurface/photosurface.qml +++ b/examples/demos/photosurface/photosurface.qml @@ -38,6 +38,7 @@ Window { nameFilters: root.imageNameFilters } delegate: Rectangle { + required property string fileModified required property string fileName required property string fileUrl id: photoFrame @@ -64,9 +65,18 @@ Window { antialiasing: true } - ToolTip.visible: mouse.hovered - ToolTip.text: fileName - ToolTip.delay: 1000 + Text { + text: fileName + " ❖ " + Qt.formatDateTime(fileModified, Locale.LongFormat) + horizontalAlignment: Text.AlignHCenter + elide: Text.ElideRight + font.pixelSize: (parent.height - image.height) / 3 + anchors { + left: parent.left + right: parent.right + bottom: parent.bottom + margins: font.pixelSize / 5 + } + } MomentumAnimation { id: anim |