[Development] Proposal to deprecate the amazing QApplication::globalStrut
André Pönitz
apoenitz at t-online.de
Thu Dec 5 20:05:12 CET 2019
On Thu, Dec 05, 2019 at 06:12:53PM +0100, Giuseppe D'Angelo via Development wrote:
> Il 04/12/19 12:56, Volker Hilsheimer ha scritto:
> > IIRC, then I added that in the early Qt 2 days, anticipating that with
> > Qt/Embedded we might see our widgets landing on touch screens “any moment
> > now”. The idea was to have a global setting that ensured that widgets and
> > other interactables (such as menu items, list items, checkbox markers etc) are
> > at least x,y pixels large.
> >
> > Well, the world has moved on, and the value has never been consistely used in
> > styles or widgets anyway.
>
> Ignoring for a moment the rest of the discussion: does such a value _make sense_
> in the first place?
>
> Qt-provided styles always tried to follow the OS native style, even in the
> sizing of the controls. Arbitrarily resizing controls has always been possible,
> but generally doing that either violates the guidelines of the native style
> (e.g. making a push button 100px high) or breaks the widget altogether (making a
> push button 5px high).
>
> In this light, what's the idea of a global minimum size useful for? A native
> style should rightfully completely ignore it. A non-native style could have it a
> as a tunable parameter, but then, actually, it could have _any_ amount of
> tunable parameters (e.g. have a minimum size for buttons, a minimum size for
> labels, etc.).
>
> Does anyone have more insights?
I have no insight, but I can imagine scenarios where e.g. visually impaired
would like to increase minimum size of UI elements also for desktop applications
wihout necessarily applying some global scaling to all elements.
Not matching native style is certainly a minor issue in this context.
That's pure speculation though, and at least in the Qt Creator context
I am not aware that such a request has ever been made, and I doubt that
the current two(!) uses of QApplication::globalStrut() would be sufficient
to meet such need accidentaly.
Andre'
More information about the Development
mailing list