qt - Placing single line of text centered in its parent in QML -
this task seems simple , still can not work.
i want place single line of text, inside of parent.
the following should sufficient far know (and when read documentation):
rectangle { width: 250 height: 200 anchors.top: parent.bottom anchors.right: parent.right text { width: parent.width height: parent.height horizontalalignment: text.alignhcenter verticalalignment: text.alignvcenter text { text: "3"; font.family: "verdana"; font.pointsize: 13 } color: "black" } }
the texts ends @ top-left corner of parent:
what going on here? please don't start suggesting should play anchor , anchormargin don't see reason using here. text going change , not in middle if start going way.
i using:
import qtquick 2.5 import qtquick.window 2.2
Comments
Post a Comment