aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlengine.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@digia.com>2014-10-10 13:32:38 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-12-05 12:26:46 +0100
commit5375c095c3eb71c669053c4ca569a960dc76fabf (patch)
treebd3d71c52eeebdcdce22644505632e9ab45eceda /src/qml/qml/qqmlengine.cpp
parentea90e7ec3449de7164a1acc91bd35847ec92d783 (diff)
QmlDebug: Provide public method for starting a debug server
With QQmlDebuggingEnabler::startTcpDebugServer you can create a debug server for debugging or profiling also without the qmljsdebugger command line argument. Change-Id: I642f73680585f9c7578762bcc0b247c736fe1338 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlengine.cpp')
-rw-r--r--src/qml/qml/qqmlengine.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index e6239f0081..2a27c543fd 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -1448,6 +1448,26 @@ QQmlDebuggingEnabler::QQmlDebuggingEnabler(bool printWarning)
#endif
}
+/*!
+ * Enables debugging for QML engines created after calling this function. The debug server will
+ * listen on \a port at \a hostName and block the QML engine until it receives a connection if
+ * \a block is true. If \a block is not specified it won't block and if \a hostName isn't specified
+ * it will listen on all available interfaces. You can only start one debug server at a time. A
+ * debug server may have already been started if the -qmljsdebugger= command line argument was
+ * given. This method returns \c true if a new debug server was successfully started, or \c false
+ * otherwise.
+ */
+bool QQmlDebuggingEnabler::startTcpDebugServer(int port, bool block, const QString &hostName)
+{
+#ifndef QQML_NO_DEBUG_PROTOCOL
+ return QQmlDebugServer::enable(port, port, block, hostName);
+#else
+ Q_UNUSED(port);
+ Q_UNUSED(block);
+ Q_UNUSED(hostName);
+ return false;
+#endif
+}
class QQmlDataExtended {
public: