diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2012-05-04 13:10:41 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-08 22:30:10 +0200 |
commit | f280efc6201adf8933c9d48a1d5b6983ee9fed9b (patch) | |
tree | 8ec0d8466b951272667d6c620959d51383902630 /src/gui/kernel/qplatformscreen_qpa.cpp | |
parent | 4a58853aeae02677e6ee1a0f0ef8839578c32573 (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/qplatformscreen_qpa.cpp')
-rw-r--r-- | src/gui/kernel/qplatformscreen_qpa.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformscreen_qpa.cpp b/src/gui/kernel/qplatformscreen_qpa.cpp index 6c2f98beb4..1fd96a80a5 100644 --- a/src/gui/kernel/qplatformscreen_qpa.cpp +++ b/src/gui/kernel/qplatformscreen_qpa.cpp @@ -161,6 +161,17 @@ QDpi QPlatformScreen::logicalDpi() const } /*! + Reimplement this function in subclass to return the vertical refresh rate + of the screen, in Hz. + + The default returns 60, a sensible default for modern displays. +*/ +qreal QPlatformScreen::refreshRate() const +{ + return 60; +} + +/*! Reimplement this function in subclass to return the current orientation of the screen, for example based on accelerometer data to determine the device orientation. |