[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Issue N49191] QT bugs



On Monday, 24. Mai 2004 17:27 Youcef Rabah Rahal wrote:
> > It's not necessarily on purpose, but since there is no defined way
> > to find out the actual size of the window caption (esp. on X11) it
> > is impossible to solve.
>
> Hmm. I was thinking about QFontMetrics::width(). The method gives
> excellent/predictible results for texts in other contexts. Isn't it
> usable in this case ?
>
> Currently, if we ever call QWidget::setFixedSize(QWidget::sizeHint())
> we end up with a widget that the user can't resize and with an
> unreadable caption if it's a little longer than the width returned by
> QWidget::sizeHint().

QFontMetrics would give you the size of the title, assuming that you
know the font that is used (which on X11 is not really possible). And
then you still don't know how big the various buttons are (system menu,
minimize, maximize, close etc), so the using QFontMetrics to calculate
the size of the title bar contents give you an educated guess, at best.

> > > b- What about adding to the library some new dialogs (like
> > > QFileDialog, QColorDialog..) in order to select the PenStyle and
> > > the BrushStyle (and even the PenJoinStyle and PenCapStyle) ? :-)
> >
> > I don't see the generic use for this. Most applications would
> > probaby rather have a combobox or some other quick solution.
>
> Well, it is useful in all apps where the user is able and wants to
> change the line style or the brush style (drawing apps). I was indeed
> thinking about using a QComboBox in the app I'm developing, but it
> would be easier for the developer if there was something already in
> the lib. But again, that is an 'enhancement' suggestion :-)

I don't say it's useless in general, but I think it's not useful enough
to make its way into a library with general-purpose solutions. I'll
bring it up with our Qt Solutions team though.

Cheers,
Volker

--
Volker Hilsheimer, Support Manager
Trolltech AS, Waldemar Thranes gate 98, NO-0175 Oslo, Norway