[Development] Proposal to deprecate the amazing QApplication::globalStrut

Uwe Rathmann Uwe.Rathmann at tigertal.de
Thu Dec 5 19:10:09 CET 2019


On 12/5/19 6:12 PM, Giuseppe D'Angelo via Development wrote:

> In this light, what's the idea of a global minimum size useful for?

It is/was useful for widget applications running on devices with touch 
screens, where the default metrics from the styles are too small.

You could argue that a good style API allows to increase all sizes by 
overloading the virtual methods, but this is very tedious and I doubt, 
that you can do everything this way.

And of course you won't be able to handle 3rd party widgets that QStyle 
does not know of. F.e for Qwt widgets only globalStrut is effective.

Proper sizeHint implementations have to look like this:

QSize QwtWheel::sizeHint() const
{
     const QSize hint = ...;
     return hint.expandedTo( QApplication::globalStrut() );
}

Uwe




More information about the Development mailing list