summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-10-09 04:29:10 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-10-09 04:29:10 (GMT)
commit9b7d77460c38ec93d98fa4779826b32bea2eaaff (patch)
treedf741aad025f325e0f15330887bcd82b0226b366 /tools
parent04511e3dbbcdf40489852babbf4753e0f744c26f (diff)
parent3a0cb6ebef245780782fcab6709e471d26789590 (diff)
downloadQt-9b7d77460c38ec93d98fa4779826b32bea2eaaff.zip
Qt-9b7d77460c38ec93d98fa4779826b32bea2eaaff.tar.gz
Qt-9b7d77460c38ec93d98fa4779826b32bea2eaaff.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.cpp49
-rw-r--r--tools/qmlviewer/qfxtester.cpp8
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");
}