Remove QPlatformScreen::pixelDensity()
This function is no longer in use - Qt Gui now computes scale factors based on logicalDpi() and logicalBaseDpi() instead. Change-Id: Ieb4b75ef4e1563694a8e12b7cdd1f60c419d5bf2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
9103d82d01
commit
f84ba3108c
@ -215,31 +215,12 @@ QDpi QPlatformScreen::logicalBaseDpi() const
|
||||
implementation returns 1.0.
|
||||
|
||||
\sa QPlatformWindow::devicePixelRatio()
|
||||
\sa QPlatformScreen::pixelDensity()
|
||||
*/
|
||||
qreal QPlatformScreen::devicePixelRatio() const
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
/*!
|
||||
Reimplement this function in subclass to return the pixel density of the
|
||||
screen. This is the scale factor needed to make a low-dpi application
|
||||
usable on this screen. The default implementation returns 1.0.
|
||||
|
||||
Returning something else than 1.0 from this function causes Qt to
|
||||
apply the scale factor to the application's coordinate system.
|
||||
This is different from devicePixelRatio, which reports a scale
|
||||
factor already applied by the windowing system. A platform plugin
|
||||
typically implements one (or none) of these two functions.
|
||||
|
||||
\sa QPlatformWindow::devicePixelRatio()
|
||||
*/
|
||||
qreal QPlatformScreen::pixelDensity() const
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
/*!
|
||||
Reimplement this function in subclass to return the vertical refresh rate
|
||||
of the screen, in Hz.
|
||||
|
@ -119,7 +119,6 @@ public:
|
||||
virtual QDpi logicalDpi() const;
|
||||
virtual QDpi logicalBaseDpi() const;
|
||||
virtual qreal devicePixelRatio() const;
|
||||
virtual qreal pixelDensity() const;
|
||||
|
||||
virtual qreal refreshRate() const;
|
||||
|
||||
|
@ -234,11 +234,6 @@ QDpi QEglFSDeviceIntegration::logicalDpi() const
|
||||
return QDpi(100, 100);
|
||||
}
|
||||
|
||||
qreal QEglFSDeviceIntegration::pixelDensity() const
|
||||
{
|
||||
return qMax(1, qRound(logicalDpi().first / qreal(100)));
|
||||
}
|
||||
|
||||
Qt::ScreenOrientation QEglFSDeviceIntegration::nativeOrientation() const
|
||||
{
|
||||
return Qt::PrimaryOrientation;
|
||||
|
@ -80,7 +80,6 @@ public:
|
||||
virtual QSizeF physicalScreenSize() const;
|
||||
virtual QSize screenSize() const;
|
||||
virtual QDpi logicalDpi() const;
|
||||
virtual qreal pixelDensity() const;
|
||||
virtual Qt::ScreenOrientation nativeOrientation() const;
|
||||
virtual Qt::ScreenOrientation orientation() const;
|
||||
virtual int screenDepth() const;
|
||||
|
@ -115,11 +115,6 @@ QDpi QEglFSScreen::logicalDpi() const
|
||||
return qt_egl_device_integration()->logicalDpi();
|
||||
}
|
||||
|
||||
qreal QEglFSScreen::pixelDensity() const
|
||||
{
|
||||
return qt_egl_device_integration()->pixelDensity();
|
||||
}
|
||||
|
||||
Qt::ScreenOrientation QEglFSScreen::nativeOrientation() const
|
||||
{
|
||||
return qt_egl_device_integration()->nativeOrientation();
|
||||
|
@ -74,7 +74,6 @@ public:
|
||||
|
||||
QSizeF physicalSize() const override;
|
||||
QDpi logicalDpi() const override;
|
||||
qreal pixelDensity() const override;
|
||||
Qt::ScreenOrientation nativeOrientation() const override;
|
||||
Qt::ScreenOrientation orientation() const override;
|
||||
|
||||
|
@ -85,11 +85,6 @@ QDpi QEglFSEmulatorScreen::logicalDpi() const
|
||||
return QDpi(100, 100);
|
||||
}
|
||||
|
||||
qreal QEglFSEmulatorScreen::pixelDensity() const
|
||||
{
|
||||
return m_pixelDensity;
|
||||
}
|
||||
|
||||
qreal QEglFSEmulatorScreen::refreshRate() const
|
||||
{
|
||||
return m_refreshRate;
|
||||
@ -163,9 +158,6 @@ void QEglFSEmulatorScreen::initFromJsonObject(const QJsonObject &description)
|
||||
m_physicalSize.setHeight(value.toInt());
|
||||
}
|
||||
|
||||
value = description.value(QLatin1String("pixelDensity"));
|
||||
if (!value.isUndefined() && value.isDouble())
|
||||
m_pixelDensity = value.toDouble();
|
||||
|
||||
value = description.value(QLatin1String("refreshRate"));
|
||||
if (!value.isUndefined() && value.isDouble())
|
||||
|
@ -58,7 +58,6 @@ public:
|
||||
QImage::Format format() const override;
|
||||
QSizeF physicalSize() const override;
|
||||
QDpi logicalDpi() const override;
|
||||
qreal pixelDensity() const override;
|
||||
qreal refreshRate() const override;
|
||||
Qt::ScreenOrientation nativeOrientation() const override;
|
||||
Qt::ScreenOrientation orientation() const override;
|
||||
@ -74,7 +73,6 @@ private:
|
||||
int m_depth;
|
||||
QImage::Format m_format;
|
||||
QSizeF m_physicalSize;
|
||||
float m_pixelDensity;
|
||||
float m_refreshRate;
|
||||
Qt::ScreenOrientation m_nativeOrientation;
|
||||
Qt::ScreenOrientation m_orientation;
|
||||
|
Loading…
Reference in New Issue
Block a user