forked from qt-creator/qt-creator
Revert "QmlApp template: Use new 4.7.1 API to enable qml debugging"
This reverts commit 424fcf8c04.
This commit is contained in:
@@ -5,12 +5,11 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
QmlApplicationViewer *viewer = QmlApplicationViewer::create();
|
QmlApplicationViewer viewer;
|
||||||
|
viewer.addImportPath(QLatin1String("modules")); // ADDIMPORTPATH
|
||||||
viewer->addImportPath(QLatin1String("modules")); // ADDIMPORTPATH
|
viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); // ORIENTATION
|
||||||
viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto); // ORIENTATION
|
viewer.setMainQmlFile(QLatin1String("qml/app/main.qml")); // MAINQML
|
||||||
viewer->setMainQmlFile(QLatin1String("qml/app/main.qml")); // MAINQML
|
viewer.show();
|
||||||
viewer->show();
|
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,8 +59,8 @@ class QmlApplicationViewerPrivate
|
|||||||
|
|
||||||
QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
|
QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
|
||||||
{
|
{
|
||||||
#if defined(Q_OS_UNIX)
|
#ifdef Q_OS_UNIX
|
||||||
#if defined(Q_OS_MAC)
|
#ifdef Q_OS_MAC
|
||||||
if (!QDir::isAbsolutePath(path))
|
if (!QDir::isAbsolutePath(path))
|
||||||
return QCoreApplication::applicationDirPath()
|
return QCoreApplication::applicationDirPath()
|
||||||
+ QLatin1String("/../Resources/") + path;
|
+ QLatin1String("/../Resources/") + path;
|
||||||
@@ -95,16 +95,6 @@ QmlApplicationViewer::~QmlApplicationViewer()
|
|||||||
delete m_d;
|
delete m_d;
|
||||||
}
|
}
|
||||||
|
|
||||||
QmlApplicationViewer *QmlApplicationViewer::create()
|
|
||||||
{
|
|
||||||
#if defined(QMLJSDEBUGGER)
|
|
||||||
QDeclarativeDebugHelper::enableDebugging();
|
|
||||||
#endif
|
|
||||||
QmlApplicationViewer *viewer = new QmlApplicationViewer();
|
|
||||||
viewer->setAttribute(Qt::WA_DeleteOnClose);
|
|
||||||
return viewer;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QmlApplicationViewer::setMainQmlFile(const QString &file)
|
void QmlApplicationViewer::setMainQmlFile(const QString &file)
|
||||||
{
|
{
|
||||||
m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
|
m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
|
||||||
@@ -118,7 +108,7 @@ void QmlApplicationViewer::addImportPath(const QString &path)
|
|||||||
|
|
||||||
void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
|
void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
|
||||||
{
|
{
|
||||||
#if defined(Q_OS_SYMBIAN)
|
#ifdef Q_OS_SYMBIAN
|
||||||
if (orientation != ScreenOrientationAuto) {
|
if (orientation != ScreenOrientationAuto) {
|
||||||
#if defined(ORIENTATIONLOCK)
|
#if defined(ORIENTATIONLOCK)
|
||||||
const CAknAppUiBase::TAppUiOrientation uiOrientation =
|
const CAknAppUiBase::TAppUiOrientation uiOrientation =
|
||||||
@@ -156,7 +146,7 @@ void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
|
|||||||
|
|
||||||
void QmlApplicationViewer::showExpanded()
|
void QmlApplicationViewer::showExpanded()
|
||||||
{
|
{
|
||||||
#if defined(Q_OS_SYMBIAN)
|
#ifdef Q_OS_SYMBIAN
|
||||||
showFullScreen();
|
showFullScreen();
|
||||||
#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
|
#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
|
||||||
showMaximized();
|
showMaximized();
|
||||||
|
|||||||
@@ -23,18 +23,15 @@ public:
|
|||||||
ScreenOrientationAuto
|
ScreenOrientationAuto
|
||||||
};
|
};
|
||||||
|
|
||||||
|
explicit QmlApplicationViewer(QWidget *parent = 0);
|
||||||
virtual ~QmlApplicationViewer();
|
virtual ~QmlApplicationViewer();
|
||||||
|
|
||||||
static QmlApplicationViewer *create();
|
|
||||||
|
|
||||||
void setMainQmlFile(const QString &file);
|
void setMainQmlFile(const QString &file);
|
||||||
void addImportPath(const QString &path);
|
void addImportPath(const QString &path);
|
||||||
void setOrientation(ScreenOrientation orientation);
|
void setOrientation(ScreenOrientation orientation);
|
||||||
void showExpanded();
|
void showExpanded();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit QmlApplicationViewer(QWidget *parent = 0);
|
|
||||||
|
|
||||||
class QmlApplicationViewerPrivate *m_d;
|
class QmlApplicationViewerPrivate *m_d;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user