QQmlDebuggingEnabler Struct
Public Types
enum | StartMode { DoNotWaitForClient, WaitForClient } |
Static Public Members
bool | connectToLocalDebugger(const QString &socketFileName, QQmlDebuggingEnabler::StartMode mode = DoNotWaitForClient) |
QStringList | debuggerServices() |
QStringList | inspectorServices() |
QStringList | nativeDebuggerServices() |
QStringList | profilerServices() |
void | setServices(const QStringList &services) |
bool | startDebugConnector(const QString &pluginName, const QVariantHash &configuration = QVariantHash()) |
bool | startTcpDebugServer(int port, QQmlDebuggingEnabler::StartMode mode = DoNotWaitForClient, const QString &hostName = QString()) |
Member Type Documentation
enum QQmlDebuggingEnabler::StartMode
Defines the debug connector's start behavior. You can interrupt QML engines starting while a debug client is connecting, in order to set breakpoints in or profile startup code.
Constant | Value | Description |
---|---|---|
QQmlDebuggingEnabler::DoNotWaitForClient | 0 | Run any QML engines as usual while the debug services are connecting. |
QQmlDebuggingEnabler::WaitForClient | 1 | If a QML engine starts while the debug services are connecting, interrupt it until they are done. |
Member Function Documentation
[static]
bool QQmlDebuggingEnabler::connectToLocalDebugger(const QString &socketFileName, QQmlDebuggingEnabler::StartMode mode = DoNotWaitForClient)
Enables debugging for QML engines created after calling this function. The debug connector will connect to a debugger waiting on a local socket at the given socketFileName and block the QML engine until the connection is established if mode is WaitForClient
. If mode is not specified it will not block. You can only start one debug connector at a time. A debug connector may have already been started if the -qmljsdebugger= command line argument was given. This method returns true
if a new debug connector was successfully started, or false
otherwise.
This function was introduced in Qt 5.6.
[static]
QStringList QQmlDebuggingEnabler::debuggerServices()
Retrieves the plugin keys of the debugger services provided by default. The debugger services enable a debug client to use a Qml/JavaScript debugger, in order to set breakpoints, pause execution, evaluate expressions and similar debugging tasks. Returns List of plugin keys of default debugger services.
[static]
QStringList QQmlDebuggingEnabler::inspectorServices()
Retrieves the plugin keys of the inspector services provided by default. The inspector services enable a debug client to use a visual inspector tool for Qt Quick. Returns List of plugin keys of default inspector services.
[static]
QStringList QQmlDebuggingEnabler::nativeDebuggerServices()
Retrieves the plugin keys of the debug services designed to be used with a native debugger. The native debugger will communicate with these services by directly reading and writing the application's memory. Returns List of plugin keys of debug services designed to be used with a native debugger.
[static]
QStringList QQmlDebuggingEnabler::profilerServices()
Retrieves the names of the profiler services provided by default. The profiler services enable a debug client to use a profiler and track the time taken by various QML and JavaScript constructs, as well as the QtQuick SceneGraph. Returns List of plugin keys of default profiler services.
[static]
void QQmlDebuggingEnabler::setServices(const QStringList &services)
Restricts the services available from the debug connector. The connector will scan plugins in the "qmltooling" subdirectory of the default plugin path. If this function is not called before the debug connector is enabled, all services found that way will be available to any client. If this function is called, only the services with plugin keys given in services will be available.
Use this method to disable debugger and inspector services when profiling to get better performance and more realistic profiles. The debugger service will put any JavaScript engine it connects to into interpreted mode, disabling the JIT compiler.
See also debuggerServices(), profilerServices(), and inspectorServices().
[static]
bool QQmlDebuggingEnabler::startDebugConnector(const QString &pluginName, const QVariantHash &configuration = QVariantHash())
Enables debugging for QML engines created after calling this function. A debug connector plugin specified by pluginName will be loaded and started using the given configuration. Supported configuration entries and their semantics depend on the plugin being loaded. You can only start one debug connector at a time. A debug connector may have already been started if the -qmljsdebugger= command line argument was given. This method returns true
if a new debug connector was successfully started, or false
otherwise.
This function was introduced in Qt 5.7.
[static]
bool QQmlDebuggingEnabler::startTcpDebugServer(int port, QQmlDebuggingEnabler::StartMode mode = DoNotWaitForClient, const QString &hostName = QString())
Enables debugging for QML engines created after calling this function. The debug connector will listen on port at hostName and block the QML engine until it receives a connection if mode is WaitForClient
. If mode is not specified it won't block and if hostName is not specified it will listen on all available interfaces. You can only start one debug connector at a time. A debug connector may have already been started if the -qmljsdebugger= command line argument was given. This method returns true
if a new debug connector was successfully started, or false
otherwise.