Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.6.1
-
None
-
Ubuntu x11/wayland
Description
When specifying a Chinese text for TextInput, it will lead to invalid vertical centering, even though verticalAlignment: TextInput.AlignVCenter was specified.
Based on my tests, this issue occurs under Ubuntu x11/ wayland, but works fine on Windows.
Additionally, marking autoScroll: false can perform as a workaround for this problem.
The code and screenshot are as follows, and the complete project can also be downloaded in the attachment.
import QtQuick import QtQuick.ControlsWindow { width: 640 height: 480 visible: true title: qsTr("Hello World") Rectangle { id: rec x: 100 y: 200 width: 400 height: 100 border.width:1 } TextInput { id: textEdit anchors.fill: rec text: "这是一段中文" font.pixelSize: 30 verticalAlignment: TextInput.AlignVCenter padding: 0 // Uncomment to align text vertically center // autoScroll: false } }