From 9aec6efd1f7e0c4922253163efc2e7ea7e751f0f Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Fri, 21 Dec 2012 15:42:47 -0800 Subject: 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> --- tests/auto/qml/debugger/shared/debugutil.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/auto/qml/debugger/shared') 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 #include +#include +#include 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; -- cgit v1.2.3