summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/qml/main.cpp2
-rw-r--r--tools/qml/qmlruntime.cpp20
-rw-r--r--tools/qml/qmlruntime.h5
3 files changed, 20 insertions, 7 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
index 78f0c87..fb687ac 100644
--- a/tools/qml/main.cpp
+++ b/tools/qml/main.cpp
@@ -54,7 +54,7 @@
QT_USE_NAMESPACE
-QtMsgHandler systemMsgOutput;
+QtMsgHandler systemMsgOutput = 0;
#if defined (Q_OS_SYMBIAN)
#include <unistd.h>
diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp
index fe0f67c..06fa004 100644
--- a/tools/qml/qmlruntime.cpp
+++ b/tools/qml/qmlruntime.cpp
@@ -535,6 +535,8 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
connect(&autoStartTimer, SIGNAL(triggered()), this, SLOT(autoStartRecording()));
connect(&autoStopTimer, SIGNAL(triggered()), this, SLOT(autoStopRecording()));
connect(&recordTimer, SIGNAL(triggered()), this, SLOT(recordFrame()));
+ connect(DeviceOrientation::instance(), SIGNAL(orientationChanged()),
+ this, SLOT(orientationChanged()), Qt::QueuedConnection);
autoStartTimer.setRunning(false);
autoStopTimer.setRunning(false);
recordTimer.setRunning(false);
@@ -543,6 +545,7 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
QDeclarativeViewer::~QDeclarativeViewer()
{
+ delete loggerWindow;
canvas->engine()->setNetworkAccessManagerFactory(0);
delete namFactory;
}
@@ -967,10 +970,8 @@ void QDeclarativeViewer::statusChanged()
if (canvas->status() == QDeclarativeView::Ready) {
initialSize = canvas->sizeHint();
if (canvas->resizeMode() == QDeclarativeView::SizeRootObjectToView) {
- QSize newWindowSize = initialSize;
- newWindowSize.setHeight(newWindowSize.height()+menuBarHeight());
updateSizeHints();
- resize(newWindowSize);
+ resize(QSize(initialSize.width(), initialSize.height()+menuBarHeight()));
}
}
}
@@ -1424,6 +1425,19 @@ void QDeclarativeViewer::recordFrame()
}
}
+void QDeclarativeViewer::orientationChanged()
+{
+ if (canvas->resizeMode() == QDeclarativeView::SizeRootObjectToView) {
+ if (canvas->rootObject()) {
+ QSizeF rootObjectSize = canvas->rootObject()->boundingRect().size();
+ QSize newSize(rootObjectSize.width(), rootObjectSize.height()+menuBarHeight());
+ if (size() != newSize) {
+ resize(newSize);
+ }
+ }
+ }
+}
+
void QDeclarativeViewer::setDeviceKeys(bool on)
{
devicemode = on;
diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h
index 655feea..9551090 100644
--- a/tools/qml/qmlruntime.h
+++ b/tools/qml/qmlruntime.h
@@ -125,6 +125,7 @@ public slots:
void showProxySettings ();
void proxySettingsChanged ();
void setScaleView();
+ void toggleOrientation();
void statusChanged();
void setSlowMode(bool);
void launch(const QString &);
@@ -132,7 +133,6 @@ public slots:
protected:
virtual void keyPressEvent(QKeyEvent *);
virtual bool event(QEvent *);
-
void createMenu(QMenuBar *menu, QMenu *flatmenu);
private slots:
@@ -144,9 +144,9 @@ private slots:
void setScaleSkin();
void setPortrait();
void setLandscape();
- void toggleOrientation();
void startNetwork();
void toggleFullScreen();
+ void orientationChanged();
void showWarnings(bool show);
void warningsWidgetOpened();
@@ -199,7 +199,6 @@ private:
QNetworkReply *wgtreply;
QString wgtdir;
-
NetworkAccessManagerFactory *namFactory;
bool useQmlFileBrowser;