diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2016-08-26 18:19:37 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2016-11-24 14:38:37 +0000 |
commit | af4516ac866cc877c3a033d6b837b30445ee8f1a (patch) | |
tree | bccb85dc9aa747892c7878a84818f3bb46d4d36d /src/qml/debugger | |
parent | 2497ae7aa87caf80fce74c6dbe36d18cb61d299a (diff) |
QmlDebug: Allow specifying debug connectors on the command line
With this change arbitrary debug connector plugins can be loaded by
specifying them in the "-qmljsdebugger=..." argument. It was already
possible to load them by using startDebugConnector(...), but that
requires source code modification.
Change-Id: I06ec7f54ec65add7cff2846ed4083ea878a04765
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/debugger')
-rw-r--r-- | src/qml/debugger/qqmldebugconnector.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/qml/debugger/qqmldebugconnector.cpp b/src/qml/debugger/qqmldebugconnector.cpp index 029df1e748..3adf335ffd 100644 --- a/src/qml/debugger/qqmldebugconnector.cpp +++ b/src/qml/debugger/qqmldebugconnector.cpp @@ -126,6 +126,16 @@ QQmlDebugConnector *QQmlDebugConnector::instance() params->instance = loadQQmlDebugConnector(params->pluginKey); } else if (params->arguments.isEmpty()) { return 0; // no explicit class name given and no command line arguments + } else if (params->arguments.startsWith(QLatin1String("connector:"))) { + static const int connectorBegin = int(strlen("connector:")); + + int connectorEnd = params->arguments.indexOf(QLatin1Char(','), connectorBegin); + if (connectorEnd == -1) + connectorEnd = params->arguments.length(); + + params->instance = loadQQmlDebugConnector(params->arguments.mid( + connectorBegin, + connectorEnd - connectorBegin)); } else { params->instance = loadQQmlDebugConnector( params->arguments.startsWith(QLatin1String("native")) ? |