summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qscreen.h
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2012-05-04 13:10:41 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-08 22:30:10 +0200
commitf280efc6201adf8933c9d48a1d5b6983ee9fed9b (patch)
tree8ec0d8466b951272667d6c620959d51383902630 /src/gui/kernel/qscreen.h
parent4a58853aeae02677e6ee1a0f0ef8839578c32573 (diff)
Added QScreen::refreshRate() to get the vertical refresh rate.
To give applications that want it the option to use a fixed timestep for animations, and to avoid having values of 60 hard-coded (we have a couple of those in qtdeclarative/src/quick already), we need to know the refresh rates of the screens we are rendering to. Change-Id: Ife49162e830440ad7eab563a27e8aebbbafc5fc5 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/gui/kernel/qscreen.h')
-rw-r--r--src/gui/kernel/qscreen.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/kernel/qscreen.h b/src/gui/kernel/qscreen.h
index f69e04a595..17f3cd3d43 100644
--- a/src/gui/kernel/qscreen.h
+++ b/src/gui/kernel/qscreen.h
@@ -83,6 +83,7 @@ class Q_GUI_EXPORT QScreen : public QObject
Q_PROPERTY(QRect availableGeometry READ availableGeometry NOTIFY availableGeometryChanged)
Q_PROPERTY(Qt::ScreenOrientation primaryOrientation READ orientation NOTIFY primaryOrientationChanged)
Q_PROPERTY(Qt::ScreenOrientation orientation READ orientation NOTIFY orientationChanged)
+ Q_PROPERTY(qreal refreshRate READ refreshRate NOTIFY refreshRateChanged)
public:
QPlatformScreen *handle() const;
@@ -127,6 +128,8 @@ public:
QPixmap grabWindow(WId window, int x, int y, int w, int h);
+ qreal refreshRate() const;
+
Q_SIGNALS:
void sizeChanged(const QSize &size);
void geometryChanged(const QRect &geometry);
@@ -140,6 +143,7 @@ Q_SIGNALS:
void availableGeometryChanged(const QRect &rect);
void primaryOrientationChanged(Qt::ScreenOrientation orientation);
void orientationChanged(Qt::ScreenOrientation orientation);
+ void refreshRateChanged(qreal refreshRate);
private:
explicit QScreen(QPlatformScreen *screen);