summaryrefslogtreecommitdiffstats
path: root/tools/qmlviewer/qmlviewer.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-17 06:58:40 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-17 06:58:40 (GMT)
commitf5668a63a9396b8f21a62a3a780f1e0023715806 (patch)
tree88cad63bd0dfea70bcf54e3eed57b8a11189fd29 /tools/qmlviewer/qmlviewer.cpp
parentfd3f9dd0f31efeea3aa0ec28b54c70d85712c7ba (diff)
parent060d833d3e0fd5a99876e0717fb26ef93fae30e1 (diff)
downloadQt-f5668a63a9396b8f21a62a3a780f1e0023715806.zip
Qt-f5668a63a9396b8f21a62a3a780f1e0023715806.tar.gz
Qt-f5668a63a9396b8f21a62a3a780f1e0023715806.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-qml: (47 commits) Add missing NOTIFY signals to various QML item class properties Fix currentIndex after itemsMoved() qmlviewer: build on symbian Revert "Replace QList<>* support with QmlListProperty" Declare QmlXmlListModelRole meta type before any code uses it. Make compile on Symbian (call Q_DECLARE_METATYPE earlier) Conditionally link webkit on wince Revert "Run dos2unix on these files." Expose LayoutItem documentation Fix palette on the N900 Fix QTBUG-8090, improve original patch effectiveness. Replace QList<>* support with QmlListProperty Run dos2unix on these files. Remove standalone QmlDebugger. It is now only available through the Mobility 404 Fix crash in QmlMetaProperty that could occur when using value-type QML binding optimizer crash QML binding optimizer crash Fix crash in QML binding optimizer Don't delete binding directly ...
Diffstat (limited to 'tools/qmlviewer/qmlviewer.cpp')
-rw-r--r--tools/qmlviewer/qmlviewer.cpp17
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);