forked from qt-creator/qt-creator
Don't generate Qt icons for Qt Quick App projects anymore. Change-Id: Ic0fc43235a5b8da6696d5eb8d4a765d49b03dfd1 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
73 lines
1.8 KiB
C++
73 lines
1.8 KiB
C++
/*
|
|
This file was generated by the Qt Quick 1 Application wizard of Qt Creator.
|
|
QtQuick1ApplicationViewer is a convenience class containing mobile device
|
|
specific code such as screen orientation handling. Also QML paths are
|
|
handled here.
|
|
It is recommended not to modify this file, since newer versions of Qt Creator
|
|
may offer an updated version of it.
|
|
*/
|
|
|
|
#include "qtquick1applicationviewer.h"
|
|
|
|
#include <QDeclarativeComponent>
|
|
#include <QDeclarativeEngine>
|
|
#include <QDeclarativeContext>
|
|
|
|
|
|
QtQuick1ApplicationViewer::QtQuick1ApplicationViewer(QWidget *parent)
|
|
: QDeclarativeView(parent)
|
|
{
|
|
connect(engine(), SIGNAL(quit()), SLOT(close()));
|
|
setResizeMode(QDeclarativeView::SizeRootObjectToView);
|
|
}
|
|
|
|
QtQuick1ApplicationViewer::~QtQuick1ApplicationViewer()
|
|
{
|
|
}
|
|
|
|
QtQuick1ApplicationViewer *QtQuick1ApplicationViewer::create()
|
|
{
|
|
return new QtQuick1ApplicationViewer();
|
|
}
|
|
|
|
void QtQuick1ApplicationViewer::setMainQmlFile(const QString &file)
|
|
{
|
|
setSource(file);
|
|
}
|
|
|
|
void QtQuick1ApplicationViewer::addImportPath(const QString &path)
|
|
{
|
|
engine()->addImportPath(path);
|
|
}
|
|
|
|
void QtQuick1ApplicationViewer::setOrientation(ScreenOrientation orientation)
|
|
{
|
|
#if QT_VERSION < 0x050000
|
|
Qt::WidgetAttribute attribute;
|
|
switch (orientation) {
|
|
case ScreenOrientationLockPortrait:
|
|
attribute = Qt::WA_LockPortraitOrientation;
|
|
break;
|
|
case ScreenOrientationLockLandscape:
|
|
attribute = Qt::WA_LockLandscapeOrientation;
|
|
break;
|
|
default:
|
|
case ScreenOrientationAuto:
|
|
attribute = Qt::WA_AutoOrientation;
|
|
break;
|
|
};
|
|
setAttribute(attribute, true);
|
|
#else // QT_VERSION < 0x050000
|
|
Q_UNUSED(orientation)
|
|
#endif // QT_VERSION < 0x050000
|
|
}
|
|
|
|
void QtQuick1ApplicationViewer::showExpanded()
|
|
{
|
|
#if defined(Q_WS_SIMULATOR) || defined(Q_OS_QNX)
|
|
showFullScreen();
|
|
#else
|
|
show();
|
|
#endif
|
|
}
|