forked from qt-creator/qt-creator
QmlStandaloneApp: Fix template to use new QDeclarativeObserver
This commit is contained in:
@@ -7,6 +7,10 @@
|
|||||||
#include <QtDeclarative/QDeclarativeEngine>
|
#include <QtDeclarative/QDeclarativeEngine>
|
||||||
#include <QtDeclarative/QDeclarativeContext>
|
#include <QtDeclarative/QDeclarativeContext>
|
||||||
|
|
||||||
|
#if defined(QMLINSPECTOR)
|
||||||
|
#include <qdeclarativeviewobserver.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
|
#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
|
||||||
#include <eikenv.h>
|
#include <eikenv.h>
|
||||||
#include <eikappui.h>
|
#include <eikappui.h>
|
||||||
@@ -41,15 +45,14 @@ QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
|
QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
|
||||||
#ifdef QMLINSPECTOR
|
QDeclarativeView(parent),
|
||||||
QmlViewer::QDeclarativeViewObserver(parent)
|
m_d(new QmlApplicationViewerPrivate)
|
||||||
#else
|
|
||||||
QDeclarativeView(parent)
|
|
||||||
#endif
|
|
||||||
, m_d(new QmlApplicationViewerPrivate)
|
|
||||||
{
|
{
|
||||||
connect(engine(), SIGNAL(quit()), SLOT(close()));
|
connect(engine(), SIGNAL(quit()), SLOT(close()));
|
||||||
setResizeMode(QDeclarativeView::SizeRootObjectToView);
|
setResizeMode(QDeclarativeView::SizeRootObjectToView);
|
||||||
|
#ifdef QMLINSPECTOR
|
||||||
|
new QmlViewer::QDeclarativeViewObserver(this, parent);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QmlApplicationViewer::~QmlApplicationViewer()
|
QmlApplicationViewer::~QmlApplicationViewer()
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
#ifndef QMLAPPLICATIONVIEWER_H
|
#ifndef QMLAPPLICATIONVIEWER_H
|
||||||
#define QMLAPPLICATIONVIEWER_H
|
#define QMLAPPLICATIONVIEWER_H
|
||||||
|
|
||||||
#ifdef QMLINSPECTOR
|
|
||||||
#include <qdeclarativeviewobserver.h>
|
|
||||||
class QmlApplicationViewer : public QmlViewer::QDeclarativeViewObserver
|
|
||||||
#else // QMLINSPECTOR
|
|
||||||
#include <QtDeclarative/QDeclarativeView>
|
#include <QtDeclarative/QDeclarativeView>
|
||||||
|
|
||||||
class QmlApplicationViewer : public QDeclarativeView
|
class QmlApplicationViewer : public QDeclarativeView
|
||||||
#endif // QMLINSPECTOR
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum Orientation {
|
enum Orientation {
|
||||||
|
|||||||
@@ -470,7 +470,7 @@ bool QmlStandaloneApp::updateFiles(const QList<QmlAppGeneratedFileInfo> &list, Q
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int QmlStandaloneApp::StubVersion = 5;
|
const int QmlStandaloneApp::StubVersion = 6;
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|||||||
Reference in New Issue
Block a user