diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-01-14 08:29:49 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-01-14 08:29:49 (GMT) |
commit | 4aa21210f946476ca36c9c8e83dc13fc25ed4c2e (patch) | |
tree | f80af57efc85c3e56d9f1ef53b812b82fc54eae1 /tools | |
parent | f4f858578afe507ecfebd807f28bad025a85e1b9 (diff) | |
download | Qt-4aa21210f946476ca36c9c8e83dc13fc25ed4c2e.zip Qt-4aa21210f946476ca36c9c8e83dc13fc25ed4c2e.tar.gz Qt-4aa21210f946476ca36c9c8e83dc13fc25ed4c2e.tar.bz2 |
Add toggle orientation option
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qmlviewer/qmlviewer.cpp | 13 | ||||
-rw-r--r-- | tools/qmlviewer/qmlviewer.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index 21288c4..2d0daea 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -540,6 +540,13 @@ void QmlViewer::createMenu(QMenuBar *menu, QMenu *flatmenu) QMenu *propertiesMenu = settingsMenu->addMenu(tr("Properties")); QActionGroup *orientation = new QActionGroup(parent); + + QAction *toggleOrientation = new QAction(tr("&Toggle Orientation"), parent); + toggleOrientation->setCheckable(true); + toggleOrientation->setShortcut(QKeySequence("Ctrl+T")); + settingsMenu->addAction(toggleOrientation); + connect(toggleOrientation, SIGNAL(triggered()), this, SLOT(toggleOrientation())); + orientation->setExclusive(true); portraitOrientation = new QAction(tr("orientation: Portrait"), parent); portraitOrientation->setCheckable(true); @@ -598,6 +605,12 @@ void QmlViewer::setLandscape() landscapeOrientation->setChecked(true); } +void QmlViewer::toggleOrientation() +{ + qWarning("HELLO"); + DeviceOrientation::instance()->setOrientation(DeviceOrientation::instance()->orientation()==DeviceOrientation::Portrait?DeviceOrientation::Landscape:DeviceOrientation::Portrait); +} + void QmlViewer::toggleFullScreen() { if (isFullScreen()) diff --git a/tools/qmlviewer/qmlviewer.h b/tools/qmlviewer/qmlviewer.h index 39bedc3..3b14d39 100644 --- a/tools/qmlviewer/qmlviewer.h +++ b/tools/qmlviewer/qmlviewer.h @@ -132,6 +132,7 @@ private slots: void adjustSizeSlot(); void setPortrait(); void setLandscape(); + void toggleOrientation(); void startNetwork(); void toggleFullScreen(); void unpackWgt(); |