diff options
| author | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2025-01-06 17:15:23 +0200 |
|---|---|---|
| committer | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2025-01-22 20:33:18 +0200 |
| commit | d25064b04d52efa39ac7415e7d48e8f64fd5e7c1 (patch) | |
| tree | a6e2d40c562790139821e12d758337145ce108cb /src/plugins/platforms/android/qandroidplatformintegration.cpp | |
| parent | 65c41c6be663b5e028430600641490c556492494 (diff) | |
Android: don't pass x/y dpi values to setDisplayMetrics()
Those values are only used to calculate the final value for the screen
size, which means we can simply do the calculation first and pass the
final values anyway and avoid carrying those params and making things
harder to read, and since those values are tied to the screen, we can
deffer calculating the physical size to the screen itself.
Dpi values are at least DisplayMetrics.DENSITY_LOW, if the xdpi/ydpi
returned metrics values are below that.
Task-number: QTBUG-132720
Change-Id: Idd6a4db24a460aeb66e626cd93d52b87566ce69c
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Diffstat (limited to 'src/plugins/platforms/android/qandroidplatformintegration.cpp')
| -rw-r--r-- | src/plugins/platforms/android/qandroidplatformintegration.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformintegration.cpp b/src/plugins/platforms/android/qandroidplatformintegration.cpp index 497b5329227..8cd67b27b51 100644 --- a/src/plugins/platforms/android/qandroidplatformintegration.cpp +++ b/src/plugins/platforms/android/qandroidplatformintegration.cpp @@ -500,8 +500,8 @@ void QAndroidPlatformIntegration::setScreenOrientation(Qt::ScreenOrientation cur void QAndroidPlatformIntegration::flushPendingUpdates() { if (m_primaryScreen) { - m_primaryScreen->setSizeParameters(m_primaryScreen->physicalSize().toSize(), - m_primaryScreen->geometry().size(), m_primaryScreen->availableGeometry()); + m_primaryScreen->setSizeParameters( + m_primaryScreen->geometry().size(), m_primaryScreen->availableGeometry()); } } @@ -542,14 +542,12 @@ void QAndroidPlatformIntegration::updateColorScheme(Qt::ColorScheme colorScheme) [] () { QAndroidPlatformTheme::instance()->updateColorScheme();}); } -void QAndroidPlatformIntegration::setScreenSizeParameters(const QSize &physicalSize, - const QSize &screenSize, +void QAndroidPlatformIntegration::setScreenSizeParameters(const QSize &screenSize, const QRect &availableGeometry) { if (m_primaryScreen) { QMetaObject::invokeMethod(m_primaryScreen, "setSizeParameters", Qt::AutoConnection, - Q_ARG(QSize, physicalSize), Q_ARG(QSize, screenSize), - Q_ARG(QRect, availableGeometry)); + Q_ARG(QSize, screenSize), Q_ARG(QRect, availableGeometry)); } } |
