Commit f987eccd authored by dt's avatar dt
Browse files

Revert "QmlApp template: Use new 4.7.1 API to enable qml debugging"

This reverts commit 424fcf8c.
parent b0622d84
......@@ -5,12 +5,11 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QmlApplicationViewer *viewer = QmlApplicationViewer::create();
viewer->addImportPath(QLatin1String("modules")); // ADDIMPORTPATH
viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto); // ORIENTATION
viewer->setMainQmlFile(QLatin1String("qml/app/main.qml")); // MAINQML
viewer->show();
QmlApplicationViewer viewer;
viewer.addImportPath(QLatin1String("modules")); // ADDIMPORTPATH
viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); // ORIENTATION
viewer.setMainQmlFile(QLatin1String("qml/app/main.qml")); // MAINQML
viewer.show();
return app.exec();
}
......@@ -59,8 +59,8 @@ class QmlApplicationViewerPrivate
QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
{
#if defined(Q_OS_UNIX)
#if defined(Q_OS_MAC)
#ifdef Q_OS_UNIX
#ifdef Q_OS_MAC
if (!QDir::isAbsolutePath(path))
return QCoreApplication::applicationDirPath()
+ QLatin1String("/../Resources/") + path;
......@@ -95,16 +95,6 @@ QmlApplicationViewer::~QmlApplicationViewer()
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)
{
m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
......@@ -118,7 +108,7 @@ void QmlApplicationViewer::addImportPath(const QString &path)
void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
{
#if defined(Q_OS_SYMBIAN)
#ifdef Q_OS_SYMBIAN
if (orientation != ScreenOrientationAuto) {
#if defined(ORIENTATIONLOCK)
const CAknAppUiBase::TAppUiOrientation uiOrientation =
......@@ -156,7 +146,7 @@ void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
void QmlApplicationViewer::showExpanded()
{
#if defined(Q_OS_SYMBIAN)
#ifdef Q_OS_SYMBIAN
showFullScreen();
#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
showMaximized();
......
......@@ -23,18 +23,15 @@ public:
ScreenOrientationAuto
};
explicit QmlApplicationViewer(QWidget *parent = 0);
virtual ~QmlApplicationViewer();
static QmlApplicationViewer *create();
void setMainQmlFile(const QString &file);
void addImportPath(const QString &path);
void setOrientation(ScreenOrientation orientation);
void showExpanded();
private:
explicit QmlApplicationViewer(QWidget *parent = 0);
class QmlApplicationViewerPrivate *m_d;
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment