[Qt-qml] anchors.horizontalCenter bug ?
alan.westbrook at nokia.com
alan.westbrook at nokia.com
Mon Jul 26 20:22:56 CEST 2010
Sounds like it. Did it work to set the horizontalAlignment instead?
Alan
On Jul 26, 2010, at 10:39 AM, ext Stephen Collyer wrote:
On 26 July 2010 17:23, <alan.westbrook at nokia.com<mailto:alan.westbrook at nokia.com>> wrote:
I think what you might want to be setting is the Text's horizontalAlignment instead of it's bounding rect's anchors:
Text
{
horizontalAlignment: Text.AlignHCenter
}
Alan
Well, the docs for the Text element say:
Note that for a single line of text, the size of the text is the area of the text. In this common case, all alignments are equivalent. If you want the text to be, say, centered in it parent, then you will need to either modify the Item::anchors, or set horizontalAlignment to Text.AlignHCenter and bind the width to that of the parent.
which explicitly mentions anchors for alignment with the parent,
so I guess this is a bug either in the code or in the docs ?
--
Stephen Collyer
<ATT00001..txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100726/9e3a765d/attachment.html
More information about the Qt-qml
mailing list