forked from qt-creator/qt-creator
QmlApp template: Use new 4.7.1 API to enable qml debugging
Qml debugging is now disabled by default, and has to be enabled explicitly (b2016bbfc9). This has to be done before the QDView/QDEngine is instantiated ... The patch introduces a static create method to QmlApplicationViewer, so that the setup can be hidden from the users main file. Reviewed-by: Alessandro Portale
This commit is contained in:
@@ -16,6 +16,10 @@
|
||||
#include <QtDeclarative/QDeclarativeEngine>
|
||||
#include <QtDeclarative/QDeclarativeContext>
|
||||
|
||||
#if defined(QMLJSDEBUGGER)
|
||||
#include <qt_private/qdeclarativedebughelper_p.h>
|
||||
#endif
|
||||
|
||||
#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
|
||||
#include <jsdebuggeragent.h>
|
||||
#endif
|
||||
@@ -30,6 +34,22 @@
|
||||
#include <aknappui.h>
|
||||
#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
|
||||
|
||||
#if defined(QMLJSDEBUGGER)
|
||||
|
||||
// Enable debugging before any QDeclarativeEngine is created
|
||||
struct QmlJsDebuggingEnabler
|
||||
{
|
||||
QmlJsDebuggingEnabler()
|
||||
{
|
||||
QDeclarativeDebugHelper::enableDebugging();
|
||||
}
|
||||
};
|
||||
|
||||
// Execute code in constructor before first QDeclarativeEngine is instantiated
|
||||
static QmlJsDebuggingEnabler enableDebuggingHelper;
|
||||
|
||||
#endif // QMLJSDEBUGGER
|
||||
|
||||
class QmlApplicationViewerPrivate
|
||||
{
|
||||
QString mainQmlFile;
|
||||
|
||||
Reference in New Issue
Block a user