[Qt-interest] Twitching Dialog layout
BRM
bm_witness at yahoo.com
Thu Feb 11 21:20:52 CET 2010
----- Original Message ----
> Subject: Re: [Qt-interest]
Twitching Dialog layout
> This twitching behavior is undesirable,
and it was suggested that I use
> a fixed-width font.
>
> Is there an easy, proper, and portable way to do this?
>
Perhaps:
> void QFont::setFixedPitch ( bool /enable/ )
Okay, this makes sense - though at least the docs for 4.5.2 don't say what
fixed pitch means (so far as I can find) - a google search revealed it
in a Qt2 series doc to say they are the fonts are all the same with.
I tried to apply it as follows:
QFont labelFont =
someLabelPointer->font();
labelFont.setFixedPitch(true);
someLabelPointer->setFont(labelFont);
However, I'm still running into the problem. I applied this to all the labels in the dialog in question.
Am I doing something wrong?
I did find the QTextFormat class which has QTextFormat::FontFixedPitch; however, I am finding an obvious way to use this class with a QLabel under Qt 4.5.1/4.5.2.
Am I missing something? Or do I need to convert my QLabel's to read-only QTextEdit?
TIA,
Ben
More information about the Qt-interest-old
mailing list