[Qt-interest] Why does QStyle::sizeFromContents leaves extra space in the end of QLineEdit?

Mihail Naydenov mlists at ymail.com
Thu Apr 2 20:57:50 CEST 2009


I noticed that QStyle::sizeFromContents(QStyle::CT_LineEdit ...) adds quite a lot space at the end - for about 4 more characters.

I guess it is intentional, and I'm more interested if I can count on that space to be constant across platforms, fonts, styles and Qt releases ?!?
I can use it, for instance, to place some button or icon, but there is a danger that it might end up over the text if this space disappears!

Also, should I preserve the space, for some reason, if I skip sizeFromContents and use my own size value?

Thank You
MihailNaydenov


      




More information about the Qt-interest-old mailing list