Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
Qt for MCUs 1.6
-
None
-
-
0
-
c1a241d2e164a28a289ee83dac33756066ac2fb1
-
QUL Sprint 1.5/2021, QUL Sprint 2.1/2021, QUL Sprint 2.2/2021, QUL Sprint 2.3/2021
Description
Here is the code snippet:
// code placeholder Rectangle { width: 480 height: 272 Text { id:text1 anchors.centerIn: parent width: 200 color: "salmon" text: "Hello World!\ntext\nthis is a test!" font.pixelSize: 24 horizontalAlignment: Text.AlignHCenter } Text { anchors.centerIn: parent width: 200 anchors.top: text1.bottom color: "salmon" text: "Hello World!\ntext\nthis is a test!" font.pixelSize: 24 // horizontalAlignment: Text.AlignHCenter } }
Here is the screenshot:
You can see the text is not in horizontal center. When in normal Qt, it looks like this:
// code placeholder Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Item{ anchors.fill: parent Text { id: name anchors.horizontalCenter: parent.horizontalCenter text: qsTr("Hello World!\ntext\nthis is a test!") horizontalAlignment: Text.AlignHCenter } } }