api: Fix const correctness of api in QScreen
authorGirish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Fri, 13 Apr 2012 22:38:41 +0000 (15:38 -0700)
committerQt by Nokia <qt-info@nokia.com>
Tue, 17 Apr 2012 04:19:49 +0000 (06:19 +0200)
const was missing in many convenience functions.

grabWindow should not be const since it actually does something.

Change-Id: I0ffa718878d4251c4fb5c34789cf58ebb85cff37
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
src/gui/kernel/qscreen.cpp
src/gui/kernel/qscreen.h

index ce26b9d..3546ce0 100644 (file)
@@ -401,7 +401,7 @@ static int log2(uint i)
 
     Qt::PrimaryOrientation is interpreted as the screen's primaryOrientation().
 */
-int QScreen::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b)
+int QScreen::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b) const
 {
     if (a == Qt::PrimaryOrientation)
         a = primaryOrientation();
@@ -436,7 +436,7 @@ int QScreen::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b)
 
     Qt::PrimaryOrientation is interpreted as the screen's primaryOrientation().
 */
-QTransform QScreen::transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target)
+QTransform QScreen::transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target) const
 {
     if (a == Qt::PrimaryOrientation)
         a = primaryOrientation();
@@ -477,7 +477,7 @@ QTransform QScreen::transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientat
 
     Qt::PrimaryOrientation is interpreted as the screen's primaryOrientation().
 */
-QRect QScreen::mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect)
+QRect QScreen::mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect) const
 {
     if (a == Qt::PrimaryOrientation)
         a = primaryOrientation();
@@ -503,7 +503,7 @@ QRect QScreen::mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, cons
 
     Qt::PrimaryOrientation is interpreted as the screen's primaryOrientation().
 */
-bool QScreen::isPortrait(Qt::ScreenOrientation o)
+bool QScreen::isPortrait(Qt::ScreenOrientation o) const
 {
     return o == Qt::PortraitOrientation || o == Qt::InvertedPortraitOrientation
         || (o == Qt::PrimaryOrientation && primaryOrientation() == Qt::PortraitOrientation);
@@ -515,7 +515,7 @@ bool QScreen::isPortrait(Qt::ScreenOrientation o)
 
     Qt::PrimaryOrientation is interpreted as the screen's primaryOrientation().
 */
-bool QScreen::isLandscape(Qt::ScreenOrientation o)
+bool QScreen::isLandscape(Qt::ScreenOrientation o) const
 {
     return o == Qt::LandscapeOrientation || o == Qt::InvertedLandscapeOrientation
         || (o == Qt::PrimaryOrientation && primaryOrientation() == Qt::LandscapeOrientation);
@@ -580,7 +580,7 @@ void QScreenPrivate::updatePrimaryOrientation()
     safe. This depends on the underlying window system.
 */
 
-QPixmap QScreen::grabWindow(WId window, int x, int y, int w, int h) const
+QPixmap QScreen::grabWindow(WId window, int x, int y, int w, int h)
 {
     const QPlatformScreen *platformScreen = handle();
     if (!platformScreen) {
index 3bd24db..f69e04a 100644 (file)
@@ -118,14 +118,14 @@ public:
     Qt::ScreenOrientation primaryOrientation() const;
     Qt::ScreenOrientation orientation() const;
 
-    int angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b);
-    QTransform transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target);
-    QRect mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect);
+    int angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b) const;
+    QTransform transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target) const;
+    QRect mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect) const;
 
-    bool isPortrait(Qt::ScreenOrientation orientation);
-    bool isLandscape(Qt::ScreenOrientation orientation);
+    bool isPortrait(Qt::ScreenOrientation orientation) const;
+    bool isLandscape(Qt::ScreenOrientation orientation) const;
 
-    QPixmap grabWindow(WId window, int x, int y, int w, int h) const;
+    QPixmap grabWindow(WId window, int x, int y, int w, int h);
 
 Q_SIGNALS:
     void sizeChanged(const QSize &size);