diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2009-10-09 02:44:38 (GMT) |
---|---|---|
committer | Yann Bodson <yann.bodson@nokia.com> | 2009-10-09 02:44:38 (GMT) |
commit | 3a0cb6ebef245780782fcab6709e471d26789590 (patch) | |
tree | ec93f99dc4adc75ec2cde2ee89e4df88c8ec75e9 /tools | |
parent | 8cefc95e3d91cb16ef6a7b16c18ef1e23a3911a9 (diff) | |
parent | 91c85c76d83260d794701100b36a0cc04f848932 (diff) | |
download | Qt-3a0cb6ebef245780782fcab6709e471d26789590.zip Qt-3a0cb6ebef245780782fcab6709e471d26789590.tar.gz Qt-3a0cb6ebef245780782fcab6709e471d26789590.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qmldebugger/main.cpp | 49 | ||||
-rw-r--r-- | tools/qmlviewer/qfxtester.cpp | 8 |
2 files changed, 48 insertions, 9 deletions
diff --git a/tools/qmldebugger/main.cpp b/tools/qmldebugger/main.cpp index 7fabfb7..ccd3761 100644 --- a/tools/qmldebugger/main.cpp +++ b/tools/qmldebugger/main.cpp @@ -23,9 +23,15 @@ Q_OBJECT public: Shell(QWidget * = 0); -private slots: + void setHost(const QString &host); + void setPort(quint16 port); + void showEngineTab(); + +public slots: void connectToHost(); void disconnectFromHost(); + +private slots: void connectionStateChanged(); private: @@ -38,6 +44,7 @@ private: QPushButton *m_disconnectButton; EnginePane *m_enginePane; + QTabWidget *m_tabs; }; Shell::Shell(QWidget *parent) @@ -71,19 +78,34 @@ Shell::Shell(QWidget *parent) m_disconnectButton->setEnabled(false); connectLayout->addWidget(m_disconnectButton); - QTabWidget *tabs = new QTabWidget(this); - layout->addWidget(tabs); + m_tabs = new QTabWidget(this); + layout->addWidget(m_tabs); CanvasFrameRate *cfr = new CanvasFrameRate(&client, this); - tabs->addTab(cfr, tr("Frame Rate")); + m_tabs->addTab(cfr, tr("Frame Rate")); m_enginePane = new EnginePane(&client, this); - tabs->addTab(m_enginePane, tr("QML Engine")); + m_tabs->addTab(m_enginePane, tr("QML Engine")); QObject::connect(&client, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(connectionStateChanged())); connectionStateChanged(); } +void Shell::setHost(const QString &host) +{ + m_host->setText(host); +} + +void Shell::setPort(quint16 port) +{ + m_port->setValue(port); +} + +void Shell::showEngineTab() +{ + m_tabs->setCurrentWidget(m_enginePane); +} + void Shell::connectionStateChanged() { switch (client.state()) { @@ -132,9 +154,24 @@ int main(int argc, char ** argv) { QApplication app(argc, argv); + QStringList args = app.arguments(); + Shell shell; - shell.show(); + if (args.contains("--engine")) + shell.showEngineTab(); + + if (args.count() > 1 && args.at(1).contains(':')) { + QStringList hostAndPort = args.at(1).split(':'); + bool ok = false; + quint16 port = hostAndPort[1].toInt(&ok); + if (ok) { + shell.setHost(hostAndPort[0]); + shell.setPort(port); + shell.connectToHost(); + } + } + shell.show(); return app.exec(); } diff --git a/tools/qmlviewer/qfxtester.cpp b/tools/qmlviewer/qfxtester.cpp index 8005b0e..0ccc9c0 100644 --- a/tools/qmlviewer/qfxtester.cpp +++ b/tools/qmlviewer/qfxtester.cpp @@ -118,12 +118,14 @@ void QFxTester::imagefailure() void QFxTester::complete() { + if (options & QmlViewer::ExitOnComplete) + QApplication::exit(hasFailed?-1:0); + if (hasCompleted) return; hasCompleted = true; - if (options & QmlViewer::ExitOnComplete) - QApplication::exit(hasFailed?-1:0); - else if (options & QmlViewer::Play) + + if (options & QmlViewer::Play) qWarning("Script playback complete"); } |