diff options
author | Alan Alpert <aalpert@rim.com> | 2012-12-21 15:42:47 -0800 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-17 03:04:56 +0200 |
commit | 9aec6efd1f7e0c4922253163efc2e7ea7e751f0f (patch) | |
tree | 0dd84012338b6b8c4c2db235b7f06b6f7b568de1 /tests/auto/qml/debugger/shared | |
parent | f94c14821b5a4bede0ad1a5e41cb355880f87f97 (diff) |
Add qml tool
This tool simply runs QML files using a QQmlApplicationEngine.
It is configurable so as to behave, by default, like qmlscene in
that it will automatically place non-Window QtQuick 2 Items inside
a QQuickWindow with the size of the root item. The configuration
is extensible so that other GUI scenes can also use it by altering
the configuration files in their installation.
On OS X, it is an app bundle, and handles the QFileOpenEvent so that
it can be the tool with which qml files are usually launched by
double-clicking. (This does not break the ability to use it on the
command line too: the options still work, you just have to give the
path to the executable inside the bundle.)
Change-Id: I6bac813ce188be54842a78d7b532fcf2d54dc443
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
Diffstat (limited to 'tests/auto/qml/debugger/shared')
-rw-r--r-- | tests/auto/qml/debugger/shared/debugutil.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qml/debugger/shared/debugutil.cpp b/tests/auto/qml/debugger/shared/debugutil.cpp index ab27337d41..99647cda11 100644 --- a/tests/auto/qml/debugger/shared/debugutil.cpp +++ b/tests/auto/qml/debugger/shared/debugutil.cpp @@ -43,6 +43,8 @@ #include <QEventLoop> #include <QTimer> +#include <QFileInfo> +#include <QDir> bool QQmlDebugTest::waitForSignal(QObject *receiver, const char *member, int timeout) { QEventLoop loop; @@ -123,6 +125,17 @@ QString QQmlDebugProcess::state() void QQmlDebugProcess::start(const QStringList &arguments) { +#ifdef Q_OS_MAC + // make sure m_executable points to the actual binary even if it's inside an app bundle + QFileInfo binFile(m_executable); + if (!binFile.isExecutable()) { + QDir bundleDir(m_executable + ".app"); + if (bundleDir.exists()) { + m_executable = bundleDir.absoluteFilePath("Contents/MacOS/" + binFile.baseName()); + //qDebug() << Q_FUNC_INFO << "found bundled binary" << m_executable; + } + } +#endif m_mutex.lock(); m_port = 0; m_process.setEnvironment(m_environment); @@ -220,6 +233,9 @@ void QQmlDebugProcess::processAppOutput() m_eventLoop.quit(); continue; } + } else if (line.startsWith("qml:")) { + // ### Can't enable quiet mode because that also suppresses application output + continue; //We don't use these, but they aren't output from the app either } else { // set to true if there is output not coming from the debugger outputFromAppItself = true; |