diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-12-01 03:38:38 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-12-01 03:38:38 (GMT) |
commit | 3c115a2f574ffc54a1f629e365def931133d286a (patch) | |
tree | 41379ca76d897f010999cffabd2cb18a5210830b /tools/qmlviewer | |
parent | a1c89f8045fa57617312fac33c1c223965a791c5 (diff) | |
download | Qt-3c115a2f574ffc54a1f629e365def931133d286a.zip Qt-3c115a2f574ffc54a1f629e365def931133d286a.tar.gz Qt-3c115a2f574ffc54a1f629e365def931133d286a.tar.bz2 |
Cleanup orientation stuff.
Diffstat (limited to 'tools/qmlviewer')
-rw-r--r-- | tools/qmlviewer/qmlviewer.cpp | 16 |
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); } |