-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.3.0, 6.8.0, 6.9.3
-
None
The Text item and TextInput item have different alignment when using a mixture of fonts. For example a non-default font and then emojis so there two fonts in the text. The Text Input looks completely off center whereas the Text item looks correct.
I used this code with Qt 6.9.3 on MacOS but it affects previous versions and Windows as well. (I've attached a video of the issue)
Just type (or paste) in a string like "sss😀"
import QtQuick Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Rectangle { anchors { left: parent.left right:parent.right verticalCenter: parent.verticalCenter } height: 50 color: "red" TextInput { id: input anchors.fill: parent font: "Menlo" // Use Consolas on windows verticalAlignment: Text.AlignVCenter onEditingFinished: { textb.visible = true; visible = false; enabled = false; textb.text = text; } } } Text { id: textb anchors.fill: parent font: "Menlo" // Use Consolas on windows verticalAlignment: Text.AlignVCenter visible: false } }