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:

enter image description here

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

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -