eglfs: Enable use of Qt::AA_EnableHighDpiScaling
Support use of Qt::AA_EnableHighDpiScaling and QT_AUTO_SCREEN_SCALE_FACTOR. This makes the high-dpi scaling system use the screen configuration set with QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT. Implement QEglFSScreen::pixelDensity() and make it return the scale factor for the display. The scale factor is computed as the ratio of the logical DPI to the base DPI. Change-Id: I14ed5da058024128479cb5508e056c39bd2f7563 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
This commit is contained in:
parent
08f9a1bd6a
commit
d98415dd6b
@ -219,6 +219,11 @@ QDpi QEGLDeviceIntegration::logicalDpi() const
|
|||||||
25.4 * s.height() / ps.height());
|
25.4 * s.height() / ps.height());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qreal QEGLDeviceIntegration::pixelDensity() const
|
||||||
|
{
|
||||||
|
return logicalDpi().first / qreal(100);
|
||||||
|
}
|
||||||
|
|
||||||
Qt::ScreenOrientation QEGLDeviceIntegration::nativeOrientation() const
|
Qt::ScreenOrientation QEGLDeviceIntegration::nativeOrientation() const
|
||||||
{
|
{
|
||||||
return Qt::PrimaryOrientation;
|
return Qt::PrimaryOrientation;
|
||||||
|
@ -75,6 +75,7 @@ public:
|
|||||||
virtual QSizeF physicalScreenSize() const;
|
virtual QSizeF physicalScreenSize() const;
|
||||||
virtual QSize screenSize() const;
|
virtual QSize screenSize() const;
|
||||||
virtual QDpi logicalDpi() const;
|
virtual QDpi logicalDpi() const;
|
||||||
|
virtual qreal pixelDensity() const;
|
||||||
virtual Qt::ScreenOrientation nativeOrientation() const;
|
virtual Qt::ScreenOrientation nativeOrientation() const;
|
||||||
virtual Qt::ScreenOrientation orientation() const;
|
virtual Qt::ScreenOrientation orientation() const;
|
||||||
virtual int screenDepth() const;
|
virtual int screenDepth() const;
|
||||||
|
@ -82,6 +82,11 @@ QDpi QEglFSScreen::logicalDpi() const
|
|||||||
return qt_egl_device_integration()->logicalDpi();
|
return qt_egl_device_integration()->logicalDpi();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qreal QEglFSScreen::pixelDensity() const
|
||||||
|
{
|
||||||
|
return qt_egl_device_integration()->pixelDensity();
|
||||||
|
}
|
||||||
|
|
||||||
Qt::ScreenOrientation QEglFSScreen::nativeOrientation() const
|
Qt::ScreenOrientation QEglFSScreen::nativeOrientation() const
|
||||||
{
|
{
|
||||||
return qt_egl_device_integration()->nativeOrientation();
|
return qt_egl_device_integration()->nativeOrientation();
|
||||||
|
@ -55,6 +55,7 @@ public:
|
|||||||
|
|
||||||
QSizeF physicalSize() const Q_DECL_OVERRIDE;
|
QSizeF physicalSize() const Q_DECL_OVERRIDE;
|
||||||
QDpi logicalDpi() const Q_DECL_OVERRIDE;
|
QDpi logicalDpi() const Q_DECL_OVERRIDE;
|
||||||
|
qreal pixelDensity() const Q_DECL_OVERRIDE;
|
||||||
Qt::ScreenOrientation nativeOrientation() const Q_DECL_OVERRIDE;
|
Qt::ScreenOrientation nativeOrientation() const Q_DECL_OVERRIDE;
|
||||||
Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE;
|
Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user