diff --git a/charts.pro b/charts.pro index 5db6f37..b4f89c5 100644 --- a/charts.pro +++ b/charts.pro @@ -3,8 +3,8 @@ } TEMPLATE = subdirs -SUBDIRS = src plugins demos -#examples tests +SUBDIRS = src plugins demos examples +# tests development_build: message('Development build') diff --git a/examples/qmlpiechart/main.cpp b/examples/qmlpiechart/main.cpp index 53e0b55..768a62c 100644 --- a/examples/qmlpiechart/main.cpp +++ b/examples/qmlpiechart/main.cpp @@ -19,7 +19,11 @@ ****************************************************************************/ #include -#include +#ifdef QT5_QUICK_1 + #include +#else + #include +#endif #include "qmlapplicationviewer.h" Q_DECL_EXPORT int main(int argc, char *argv[]) @@ -27,7 +31,7 @@ Q_DECL_EXPORT int main(int argc, char *argv[]) QScopedPointer app(createApplication(argc, argv)); QScopedPointer viewer(QmlApplicationViewer::create()); - viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + // // viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto); viewer->setSource(QUrl("qrc:/qml/qmlpiechart/main.qml")); viewer->setRenderHint(QPainter::Antialiasing, true); viewer->showExpanded(); diff --git a/examples/qmlpiechart/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/qmlpiechart/qmlapplicationviewer/qmlapplicationviewer.cpp index 6d37b0b..426a19d 100644 --- a/examples/qmlpiechart/qmlapplicationviewer/qmlapplicationviewer.cpp +++ b/examples/qmlpiechart/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -12,9 +12,16 @@ #include #include -#include -#include -#include +#ifdef QT5_QUICK_1 + #include + #include + #include +#else + #include + #include + #include +#endif + #include #include // MEEGO_EDITION_HARMATTAN @@ -136,48 +143,48 @@ void QmlApplicationViewer::addImportPath(const QString &path) d->view->engine()->addImportPath(d->adjustPath(path)); } -void QmlApplicationViewer::setOrientation(ScreenOrientation orientation) -{ -#if defined(Q_OS_SYMBIAN) - // If the version of Qt on the device is < 4.7.2, that attribute won't work - if (orientation != ScreenOrientationAuto) { - const QStringList v = QString::fromAscii(qVersion()).split(QLatin1Char('.')); - if (v.count() == 3 && (v.at(0).toInt() << 16 | v.at(1).toInt() << 8 | v.at(2).toInt()) < 0x040702) { - qWarning("Screen orientation locking only supported with Qt 4.7.2 and above"); - return; - } - } -#endif // Q_OS_SYMBIAN - - Qt::WidgetAttribute attribute; - switch (orientation) { -#if QT_VERSION < 0x040702 - // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes - case ScreenOrientationLockPortrait: - attribute = static_cast(128); - break; - case ScreenOrientationLockLandscape: - attribute = static_cast(129); - break; - default: - case ScreenOrientationAuto: - attribute = static_cast(130); - break; -#else // QT_VERSION < 0x040702 - case ScreenOrientationLockPortrait: - attribute = Qt::WA_LockPortraitOrientation; - break; - case ScreenOrientationLockLandscape: - attribute = Qt::WA_LockLandscapeOrientation; - break; - default: - case ScreenOrientationAuto: - attribute = Qt::WA_AutoOrientation; - break; -#endif // QT_VERSION < 0x040702 - }; - setAttribute(attribute, true); -} +//void QmlApplicationViewer::setOrientation(ScreenOrientation orientation) +//{ +//#if defined(Q_OS_SYMBIAN) +// // If the version of Qt on the device is < 4.7.2, that attribute won't work +// if (orientation != ScreenOrientationAuto) { +// const QStringList v = QString::fromAscii(qVersion()).split(QLatin1Char('.')); +// if (v.count() == 3 && (v.at(0).toInt() << 16 | v.at(1).toInt() << 8 | v.at(2).toInt()) < 0x040702) { +// qWarning("Screen orientation locking only supported with Qt 4.7.2 and above"); +// return; +// } +// } +//#endif // Q_OS_SYMBIAN + +// Qt::WidgetAttribute attribute; +// switch (orientation) { +//#if QT_VERSION < 0x040702 +// // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes +// case ScreenOrientationLockPortrait: +// attribute = static_cast(128); +// break; +// case ScreenOrientationLockLandscape: +// attribute = static_cast(129); +// break; +// default: +// case ScreenOrientationAuto: +// attribute = static_cast(130); +// break; +//#else // QT_VERSION < 0x040702 +// case ScreenOrientationLockPortrait: +// attribute = Qt::WA_LockPortraitOrientation; +// break; +// case ScreenOrientationLockLandscape: +// attribute = Qt::WA_LockLandscapeOrientation; +// break; +// default: +// case ScreenOrientationAuto: +// attribute = Qt::WA_AutoOrientation; +// break; +//#endif // QT_VERSION < 0x040702 +// }; +// setAttribute(attribute, true); +//} void QmlApplicationViewer::showExpanded() { diff --git a/examples/qmlpiechart/qmlapplicationviewer/qmlapplicationviewer.h b/examples/qmlpiechart/qmlapplicationviewer/qmlapplicationviewer.h index f8008f5..7f85658 100644 --- a/examples/qmlpiechart/qmlapplicationviewer/qmlapplicationviewer.h +++ b/examples/qmlpiechart/qmlapplicationviewer/qmlapplicationviewer.h @@ -11,7 +11,11 @@ #ifndef QMLAPPLICATIONVIEWER_H #define QMLAPPLICATIONVIEWER_H -#include +#ifdef QT5_QUICK_1 + #include +#else + #include +#endif class QmlApplicationViewer : public QDeclarativeView { @@ -33,7 +37,7 @@ public: void addImportPath(const QString &path); // Note that this will only have an effect on Symbian and Fremantle. - void setOrientation(ScreenOrientation orientation); + // void setOrientation(ScreenOrientation orientation); void showExpanded(); diff --git a/examples/scrollchart/chart.h b/examples/scrollchart/chart.h index 0f39663..a8cf6cb 100644 --- a/examples/scrollchart/chart.h +++ b/examples/scrollchart/chart.h @@ -23,6 +23,8 @@ #include +class QGestureEvent; + QTCOMMERCIALCHART_USE_NAMESPACE //![1] diff --git a/examples/zoomlinechart/chart.h b/examples/zoomlinechart/chart.h index 0f39663..a8cf6cb 100644 --- a/examples/zoomlinechart/chart.h +++ b/examples/zoomlinechart/chart.h @@ -23,6 +23,8 @@ #include +class QGestureEvent; + QTCOMMERCIALCHART_USE_NAMESPACE //![1]