Warn on setHighDpiScaleFactorRoundingPolicy misuse
The rounding policy is used to calculate QScreen geometry during startup. Changing it afterwards is not supported since we don't have an update mechanism. This restriction is already documented but printing a warning makes sense since this is easy to miss. Fixes: QTBUG-123102 Change-Id: Ib88511e61abbf97436a13dc5d38d3d1fbd5aab2c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
parent
b4090305d0
commit
d570293bb8
@ -3797,6 +3797,8 @@ Qt::ApplicationState QGuiApplication::applicationState()
|
||||
*/
|
||||
void QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy policy)
|
||||
{
|
||||
if (qApp)
|
||||
qWarning("setHighDpiScaleFactorRoundingPolicy must be called before creating the QGuiApplication instance");
|
||||
QGuiApplicationPrivate::highDpiScaleFactorRoundingPolicy = policy;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user