[Qt-interest] Fixed width QLineEdit boxes.
phil prentice
philp.cheer at talktalk.net
Thu Feb 25 09:10:30 CET 2010
Hi Diego
I'm really sorry. I did mean to reply to the list...I was tired and obviously
pushed the wrong buttons. I am very happy with what I have from your earlier
suggestions....it was purely interest that I asked the question.
Thanks again and sorry that I sent the mail directly to you.
Phil
On Thursday 25 February 2010 06:26, you wrote:
> Hi Phill,
>
> Please reply again to the list, as I have no clue, and I have no time to
> check that at work today ;-)
>
> On Wed, Feb 24, 2010 at 9:53 PM, phil prentice
<philp.cheer at talktalk.net>wrote:
> > Thanks again for your help
> >
> > > Do you want to query the list of fonts, and see which one of them is
> >
> > fixed?
> >
> > In my case I have managed to do what I need using your suggestions.
> > However I
> > would be very interested in knowing how you might be able to query the
> > list of fonts. This is the second time I have come across this problem.
> >
> > Thanks
> > Phil
> >
> > On Wednesday 24 February 2010 15:16, you wrote:
> > > On Wed, Feb 24, 2010 at 2:52 PM, phil prentice
> >
> > <philp.cheer at talktalk.net>wrote:
> > > > Thank you Diego for your help
> > > >
> > > > How exactly do I specify a fixed size font in QT? Do I have to do
> > > > something like this?
> > > >
> > > > setFont(QFont("Monspace", 7));
> > > >
> > > > where Monospace I presume would have to be defined as a fixed size
> >
> > font??
> >
> > > > What makes the font a fixed width one?
> > >
> > > I also check for platforms (sketch up code... not tested)
> > >
> > > QFont f;
> > > #ifdef __WIN32__
> > > f.setFont(QFont("Courier New", 8));
> > > #else
> > > f.setFont(QFont("Monospace", 10));
> > > #endif
> > > QFontMetrics fm( f );
> > > int pixelWidth = fm.width( "00" );
> > > widget->setFixedWidth( pixelWidth + 10 ); // leave out some margins
> > >
> > > Do you want to query the list of fonts, and see which one of them is
> >
> > fixed?
More information about the Qt-interest-old
mailing list