From 917307b393e613a891fa762f70cb676e33ca68ee Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Fri, 20 Aug 2010 16:10:10 +1000 Subject: Add a menu option to open remote files in the QML viewer Task-number: QTBUG-11019 --- tools/qml/qmlruntime.cpp | 14 ++++++++++++++ tools/qml/qmlruntime.h | 1 + 2 files changed, 15 insertions(+) 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 #include #include +#include #include #include #include @@ -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) diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h index 6fa7d81..d1ec26d 100644 --- a/tools/qml/qmlruntime.h +++ b/tools/qml/qmlruntime.h @@ -113,6 +113,7 @@ public slots: void sceneResized(QSize size); bool open(const QString&); void openFile(); + void openUrl(); void reload(); void takeSnapShot(); void toggleRecording(); -- cgit v0.12 xt' type='text' size='10' name='q' value=''/>
path: root/Parser
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-02-07 14:23:11 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-02-07 14:23:11 (GMT)
commitd5327d95d2c345f384cc9d03be0d9c4e8773b277 (patch)
tree74e52941161cdeecf518a2647568cddc5a4ba84d /Parser
parent4a880414447c9a8f9db7711275ff33c552d86642 (diff)
downloadcpython-d5327d95d2c345f384cc9d03be0d9c4e8773b277.zip
cpython-d5327d95d2c345f384cc9d03be0d9c4e8773b277.tar.gz
cpython-d5327d95d2c345f384cc9d03be0d9c4e8773b277.tar.bz2
Issue #17043: The unicode-internal decoder no longer read past the end of
input buffer.
hes when concurrently iterate over itertools.groupby() iterators. (GH-1557) (#3770)
(cherry picked from commit c740e4fe8a9bc5815dc18c38d7f7600b128c3c51)