summaryrefslogtreecommitdiffstats
path: root/tools/qmlviewer
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-12-01 03:38:38 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-12-01 03:38:38 (GMT)
commit3c115a2f574ffc54a1f629e365def931133d286a (patch)
tree41379ca76d897f010999cffabd2cb18a5210830b /tools/qmlviewer
parenta1c89f8045fa57617312fac33c1c223965a791c5 (diff)
downloadQt-3c115a2f574ffc54a1f629e365def931133d286a.zip
Qt-3c115a2f574ffc54a1f629e365def931133d286a.tar.gz
Qt-3c115a2f574ffc54a1f629e365def931133d286a.tar.bz2
Cleanup orientation stuff.
Diffstat (limited to 'tools/qmlviewer')
-rw-r--r--tools/qmlviewer/qmlviewer.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp
index 8c50b09..98a9702 100644
--- a/tools/qmlviewer/qmlviewer.cpp
+++ b/tools/qmlviewer/qmlviewer.cpp
@@ -94,31 +94,19 @@ class Screen : public QObject
public:
Screen(QObject *parent=0) : QObject(parent) {
- m_screens.append(this);
connect(DeviceOrientation::instance(), SIGNAL(orientationChanged()),
this, SIGNAL(orientationChanged()));
}
- ~Screen() { m_screens.removeAll(this); }
enum Orientation { UnknownOrientation = DeviceOrientation::UnknownOrientation,
Portrait = DeviceOrientation::Portrait,
Landscape = DeviceOrientation::Landscape };
Orientation orientation() const { return Orientation(DeviceOrientation::instance()->orientation()); }
- static void setOrientation(Orientation orient) {
- if (orient != Orientation(DeviceOrientation::instance()->orientation())) {
- DeviceOrientation::instance()->setOrientation(DeviceOrientation::Orientation(orient));
- }
- }
signals:
void orientationChanged();
-
-private:
- static QList<Screen*> m_screens;
};
-QList<Screen*> Screen::m_screens;
-
QML_DECLARE_TYPE(Screen)
QML_DEFINE_TYPE(QmlViewer, 1, 0, Screen, Screen)
@@ -570,13 +558,13 @@ void QmlViewer::proxySettingsChanged()
void QmlViewer::setPortrait()
{
- Screen::setOrientation(Screen::Portrait);
+ DeviceOrientation::instance()->setOrientation(DeviceOrientation::Portrait);
portraitOrientation->setChecked(true);
}
void QmlViewer::setLandscape()
{
- Screen::setOrientation(Screen::Landscape);
+ DeviceOrientation::instance()->setOrientation(DeviceOrientation::Landscape);
landscapeOrientation->setChecked(true);
}