diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2010-08-25 16:00:47 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-08-25 16:00:47 (GMT) |
commit | 913ea0d5cdee3a182a811db2bb9440aee679ae08 (patch) | |
tree | 79708faf5c379948eb5aa2f84cb24488a9cb0c4f /tools/qml/qmlruntime.cpp | |
parent | 5c45c66b1743645b77826ad61508a79eadd48414 (diff) | |
parent | d9dd68c4400c3ca590ea425d6f3d070ea6094099 (diff) | |
download | Qt-913ea0d5cdee3a182a811db2bb9440aee679ae08.zip Qt-913ea0d5cdee3a182a811db2bb9440aee679ae08.tar.gz Qt-913ea0d5cdee3a182a811db2bb9440aee679ae08.tar.bz2 |
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts:
qmake/generators/win32/msbuild_objectmodel.cpp
src/declarative/qml/qdeclarativexmlhttprequest.cpp
src/opengl/opengl.pro
src/opengl/qgl_p.h
src/plugins/bearer/connman/qconnmanservice_linux.cpp
tests/auto/qpainter/tst_qpainter.cpp
tools/assistant/tools/assistant/helpviewer_qwv.h
tools/assistant/tools/assistant/openpageswidget.h
Diffstat (limited to 'tools/qml/qmlruntime.cpp')
-rw-r--r-- | tools/qml/qmlruntime.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp index b9fd570..321b7fd 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -85,6 +85,7 @@ #include <QMenu> #include <QAction> #include <QFileDialog> +#include <QInputDialog> #include <QTimer> #include <QGraphicsObject> #include <QNetworkProxyFactory> @@ -715,6 +716,9 @@ void QDeclarativeViewer::createMenu() openAction->setShortcuts(QKeySequence::Open); connect(openAction, SIGNAL(triggered()), this, SLOT(openFile())); + QAction *openUrlAction = new QAction(tr("Open &URL..."), this); + connect(openUrlAction, SIGNAL(triggered()), this, SLOT(openUrl())); + QAction *reloadAction = new QAction(tr("&Reload"), this); reloadAction->setShortcuts(QKeySequence::Refresh); connect(reloadAction, SIGNAL(triggered()), this, SLOT(reload())); @@ -789,6 +793,7 @@ void QDeclarativeViewer::createMenu() #if defined(Q_WS_MAEMO_5) menu->addAction(openAction); + menu->addAction(openUrlAction); menu->addAction(reloadAction); menu->addAction(snapshotAction); @@ -809,6 +814,7 @@ void QDeclarativeViewer::createMenu() QMenu *fileMenu = menu->addMenu(tr("&File")); fileMenu->addAction(openAction); + fileMenu->addAction(openUrlAction); fileMenu->addAction(reloadAction); fileMenu->addSeparator(); fileMenu->addAction(closeAction); @@ -1021,6 +1027,14 @@ void QDeclarativeViewer::openFile() } } +void QDeclarativeViewer::openUrl() +{ + QString cur = canvas->source().toLocalFile(); + QString url= QInputDialog::getText(this, tr("Open QML file"), tr("URL of main QML file:"), QLineEdit::Normal, cur); + if (!url.isEmpty()) + open(url); +} + void QDeclarativeViewer::statusChanged() { if (canvas->status() == QDeclarativeView::Error && tester) |