diff options
| author | Martin Jones <martin.jones@nokia.com> | 2010-02-16 01:32:35 (GMT) |
|---|---|---|
| committer | Martin Jones <martin.jones@nokia.com> | 2010-02-16 01:32:35 (GMT) |
| commit | 6f3649260d157584361112a94733b92f10c01b84 (patch) | |
| tree | 13197132bd1f3854572728ff1699fa6780021365 /tools/qmlviewer/qmlviewer.cpp | |
| parent | b77e592cf9709c31f61c3e1d229b2a6c446ab8bc (diff) | |
| parent | e7041de4d51a3166948924fc8640c8c6bc8daa7b (diff) | |
| download | Qt-6f3649260d157584361112a94733b92f10c01b84.zip Qt-6f3649260d157584361112a94733b92f10c01b84.tar.gz Qt-6f3649260d157584361112a94733b92f10c01b84.tar.bz2 | |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml
Diffstat (limited to 'tools/qmlviewer/qmlviewer.cpp')
| -rw-r--r-- | tools/qmlviewer/qmlviewer.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index 1566473..7c620ef 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -52,8 +52,9 @@ #include <QAbstractAnimation> #include "deviceskin.h" -#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 2)) +#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 3)) #include <private/qzipreader_p.h> +#define QMLVIEWER_ZIP_SUPPORT #endif #include <QSettings> @@ -107,7 +108,6 @@ QT_BEGIN_NAMESPACE - class Screen : public QObject { Q_OBJECT @@ -130,7 +130,12 @@ signals: void orientationChanged(); }; +QT_END_NAMESPACE + QML_DECLARE_TYPE(Screen) + +QT_BEGIN_NAMESPACE + QML_DEFINE_TYPE(QmlViewer, 1, 0, Screen, Screen) class SizedMenuBar : public QMenuBar @@ -866,7 +871,7 @@ void QmlViewer::reload() void QmlViewer::open(const QString& doc) { -#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 2)) +#ifdef QMLVIEWER_ZIP_SUPPORT if (doc.endsWith(".wgt",Qt::CaseInsensitive) || doc.endsWith(".wgz",Qt::CaseInsensitive) || doc.endsWith(".zip",Qt::CaseInsensitive)) @@ -878,7 +883,7 @@ void QmlViewer::open(const QString& doc) void QmlViewer::openWgt(const QString& doc) { -#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 2)) +#ifdef QMLVIEWER_ZIP_SUPPORT // XXX This functionality could be migrated to QmlView once refined QUrl url(doc); @@ -891,7 +896,7 @@ void QmlViewer::openWgt(const QString& doc) #endif } -#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 2)) +#ifdef QMLVIEWER_ZIP_SUPPORT static void removeRecursive(const QString& dirname) { QDir dir(dirname); @@ -907,7 +912,7 @@ static void removeRecursive(const QString& dirname) void QmlViewer::unpackWgt() { -#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 2)) +#ifdef QMLVIEWER_ZIP_SUPPORT QByteArray all = wgtreply->readAll(); QBuffer buf(&all); buf.open(QIODevice::ReadOnly); |
