@@ -3,8 +3,7 | |||||
3 | } |
|
3 | } | |
4 |
|
4 | |||
5 | TEMPLATE = subdirs |
|
5 | TEMPLATE = subdirs | |
6 | SUBDIRS = src plugins demos examples |
|
6 | SUBDIRS = src plugins demos examples tests | |
7 | # tests |
|
|||
8 |
|
7 | |||
9 | development_build: message('Development build') |
|
8 | development_build: message('Development build') | |
10 |
|
9 |
@@ -3,7 +3,7 | |||||
3 | } |
|
3 | } | |
4 |
|
4 | |||
5 | greaterThan(QT_MAJOR_VERSION, 4) { |
|
5 | greaterThan(QT_MAJOR_VERSION, 4) { | |
6 | QT += testlib |
|
6 | QT += testlib widgets | |
7 | } else { |
|
7 | } else { | |
8 | CONFIG += qtestlib |
|
8 | CONFIG += qtestlib | |
9 | } |
|
9 | } |
@@ -31,7 +31,11 private Q_SLOTS: | |||||
31 |
|
31 | |||
32 | void tst_ChartDataSet::skip() |
|
32 | void tst_ChartDataSet::skip() | |
33 | { |
|
33 | { | |
|
34 | #ifdef QT5_QUICK_1 | |||
|
35 | QSKIP("This test requires the debug version of library"); | |||
|
36 | #else | |||
34 | QSKIP("This test requires the debug version of library", SkipAll); |
|
37 | QSKIP("This test requires the debug version of library", SkipAll); | |
|
38 | #endif | |||
35 | } |
|
39 | } | |
36 |
|
40 | |||
37 | QTEST_MAIN(tst_ChartDataSet) |
|
41 | QTEST_MAIN(tst_ChartDataSet) |
@@ -32,7 +32,11 private Q_SLOTS: | |||||
32 |
|
32 | |||
33 | void tst_Domain::skip() |
|
33 | void tst_Domain::skip() | |
34 | { |
|
34 | { | |
|
35 | #ifdef QT5_QUICK_1 | |||
|
36 | QSKIP("This test requires the debug version of library"); | |||
|
37 | #else | |||
35 | QSKIP("This test requires the debug version of library", SkipAll); |
|
38 | QSKIP("This test requires the debug version of library", SkipAll); | |
|
39 | #endif | |||
36 | } |
|
40 | } | |
37 |
|
41 | |||
38 | QTEST_MAIN(tst_Domain) |
|
42 | QTEST_MAIN(tst_Domain) |
@@ -139,7 +139,11 void tst_QAbstractAxis::axisPenColor_data() | |||||
139 |
|
139 | |||
140 | void tst_QAbstractAxis::axisPenColor() |
|
140 | void tst_QAbstractAxis::axisPenColor() | |
141 | { |
|
141 | { | |
|
142 | #ifdef QT5_QUICK_1 | |||
|
143 | QSKIP("Test is not implemented. This is depreciated function"); | |||
|
144 | #else | |||
142 | QSKIP("Test is not implemented. This is depreciated function", SkipAll); |
|
145 | QSKIP("Test is not implemented. This is depreciated function", SkipAll); | |
|
146 | #endif | |||
143 | } |
|
147 | } | |
144 |
|
148 | |||
145 | void tst_QAbstractAxis::gridLinePen_data() |
|
149 | void tst_QAbstractAxis::gridLinePen_data() | |
@@ -404,7 +408,11 void tst_QAbstractAxis::labelsColor_data() | |||||
404 |
|
408 | |||
405 | void tst_QAbstractAxis::labelsColor() |
|
409 | void tst_QAbstractAxis::labelsColor() | |
406 | { |
|
410 | { | |
|
411 | #ifdef QT5_QUICK_1 | |||
|
412 | QSKIP("Test is not implemented. This is depreciated function"); | |||
|
413 | #else | |||
407 | QSKIP("Test is not implemented. This is depreciated function", SkipAll); |
|
414 | QSKIP("Test is not implemented. This is depreciated function", SkipAll); | |
|
415 | #endif | |||
408 | } |
|
416 | } | |
409 |
|
417 | |||
410 | void tst_QAbstractAxis::labelsFont_data() |
|
418 | void tst_QAbstractAxis::labelsFont_data() | |
@@ -629,7 +637,11 void tst_QAbstractAxis::shadesBorderColor_data() | |||||
629 |
|
637 | |||
630 | void tst_QAbstractAxis::shadesBorderColor() |
|
638 | void tst_QAbstractAxis::shadesBorderColor() | |
631 | { |
|
639 | { | |
|
640 | #ifdef QT5_QUICK_1 | |||
|
641 | QSKIP("Test is not implemented. This is depreciated function"); | |||
|
642 | #else | |||
632 | QSKIP("Test is not implemented. This is depreciated function", SkipAll); |
|
643 | QSKIP("Test is not implemented. This is depreciated function", SkipAll); | |
|
644 | #endif | |||
633 | } |
|
645 | } | |
634 |
|
646 | |||
635 | void tst_QAbstractAxis::shadesBrush_data() |
|
647 | void tst_QAbstractAxis::shadesBrush_data() | |
@@ -679,7 +691,11 void tst_QAbstractAxis::shadesColor_data() | |||||
679 | // public QColor shadesColor() const |
|
691 | // public QColor shadesColor() const | |
680 | void tst_QAbstractAxis::shadesColor() |
|
692 | void tst_QAbstractAxis::shadesColor() | |
681 | { |
|
693 | { | |
|
694 | #ifdef QT5_QUICK_1 | |||
|
695 | QSKIP("Test is not implemented. This is depreciated function"); | |||
|
696 | #else | |||
682 | QSKIP("Test is not implemented. This is depreciated function", SkipAll); |
|
697 | QSKIP("Test is not implemented. This is depreciated function", SkipAll); | |
|
698 | #endif | |||
683 | } |
|
699 | } | |
684 |
|
700 | |||
685 | void tst_QAbstractAxis::shadesPen_data() |
|
701 | void tst_QAbstractAxis::shadesPen_data() |
@@ -27,7 +27,7 Q_DECL_EXPORT int main(int argc, char *argv[]) | |||||
27 | QScopedPointer<QApplication> app(createApplication(argc, argv)); |
|
27 | QScopedPointer<QApplication> app(createApplication(argc, argv)); | |
28 | QScopedPointer<QmlApplicationViewer> viewer(QmlApplicationViewer::create()); |
|
28 | QScopedPointer<QmlApplicationViewer> viewer(QmlApplicationViewer::create()); | |
29 |
|
29 | |||
30 | viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto); |
|
30 | // // viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto); | |
31 | viewer->setSource(QUrl("qrc:/qml/qmlchartaxis/main.qml")); |
|
31 | viewer->setSource(QUrl("qrc:/qml/qmlchartaxis/main.qml")); | |
32 | viewer->showExpanded(); |
|
32 | viewer->showExpanded(); | |
33 |
|
33 |
@@ -12,9 +12,15 | |||||
12 |
|
12 | |||
13 | #include <QtCore/QDir> |
|
13 | #include <QtCore/QDir> | |
14 | #include <QtCore/QFileInfo> |
|
14 | #include <QtCore/QFileInfo> | |
15 | #include <QtDeclarative/QDeclarativeComponent> |
|
15 | #ifdef QT5_QUICK_1 | |
16 |
#include <Qt |
|
16 | #include <QtQuick1/QDeclarativeComponent> | |
17 |
#include <Qt |
|
17 | #include <QtQuick1/QDeclarativeEngine> | |
|
18 | #include <QtQuick1/QDeclarativeContext> | |||
|
19 | #else | |||
|
20 | #include <QtDeclarative/QDeclarativeComponent> | |||
|
21 | #include <QtDeclarative/QDeclarativeEngine> | |||
|
22 | #include <QtDeclarative/QDeclarativeContext> | |||
|
23 | #endif | |||
18 | #include <QApplication> |
|
24 | #include <QApplication> | |
19 |
|
25 | |||
20 | #include <qplatformdefs.h> // MEEGO_EDITION_HARMATTAN |
|
26 | #include <qplatformdefs.h> // MEEGO_EDITION_HARMATTAN | |
@@ -136,48 +142,48 void QmlApplicationViewer::addImportPath(const QString &path) | |||||
136 | d->view->engine()->addImportPath(d->adjustPath(path)); |
|
142 | d->view->engine()->addImportPath(d->adjustPath(path)); | |
137 | } |
|
143 | } | |
138 |
|
144 | |||
139 | void QmlApplicationViewer::setOrientation(ScreenOrientation orientation) |
|
145 | //void QmlApplicationViewer::setOrientation(ScreenOrientation orientation) | |
140 | { |
|
146 | //{ | |
141 | #if defined(Q_OS_SYMBIAN) |
|
147 | //#if defined(Q_OS_SYMBIAN) | |
142 | // If the version of Qt on the device is < 4.7.2, that attribute won't work |
|
148 | // // If the version of Qt on the device is < 4.7.2, that attribute won't work | |
143 | if (orientation != ScreenOrientationAuto) { |
|
149 | // if (orientation != ScreenOrientationAuto) { | |
144 | const QStringList v = QString::fromAscii(qVersion()).split(QLatin1Char('.')); |
|
150 | // const QStringList v = QString::fromAscii(qVersion()).split(QLatin1Char('.')); | |
145 | if (v.count() == 3 && (v.at(0).toInt() << 16 | v.at(1).toInt() << 8 | v.at(2).toInt()) < 0x040702) { |
|
151 | // if (v.count() == 3 && (v.at(0).toInt() << 16 | v.at(1).toInt() << 8 | v.at(2).toInt()) < 0x040702) { | |
146 | qWarning("Screen orientation locking only supported with Qt 4.7.2 and above"); |
|
152 | // qWarning("Screen orientation locking only supported with Qt 4.7.2 and above"); | |
147 | return; |
|
153 | // return; | |
148 | } |
|
154 | // } | |
149 | } |
|
155 | // } | |
150 | #endif // Q_OS_SYMBIAN |
|
156 | //#endif // Q_OS_SYMBIAN | |
151 |
|
157 | |||
152 | Qt::WidgetAttribute attribute; |
|
158 | // Qt::WidgetAttribute attribute; | |
153 | switch (orientation) { |
|
159 | // switch (orientation) { | |
154 | #if QT_VERSION < 0x040702 |
|
160 | //#if QT_VERSION < 0x040702 | |
155 | // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes |
|
161 | // // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes | |
156 | case ScreenOrientationLockPortrait: |
|
162 | // case ScreenOrientationLockPortrait: | |
157 | attribute = static_cast<Qt::WidgetAttribute>(128); |
|
163 | // attribute = static_cast<Qt::WidgetAttribute>(128); | |
158 | break; |
|
164 | // break; | |
159 | case ScreenOrientationLockLandscape: |
|
165 | // case ScreenOrientationLockLandscape: | |
160 | attribute = static_cast<Qt::WidgetAttribute>(129); |
|
166 | // attribute = static_cast<Qt::WidgetAttribute>(129); | |
161 | break; |
|
167 | // break; | |
162 | default: |
|
168 | // default: | |
163 | case ScreenOrientationAuto: |
|
169 | // case ScreenOrientationAuto: | |
164 | attribute = static_cast<Qt::WidgetAttribute>(130); |
|
170 | // attribute = static_cast<Qt::WidgetAttribute>(130); | |
165 | break; |
|
171 | // break; | |
166 | #else // QT_VERSION < 0x040702 |
|
172 | //#else // QT_VERSION < 0x040702 | |
167 | case ScreenOrientationLockPortrait: |
|
173 | // case ScreenOrientationLockPortrait: | |
168 | attribute = Qt::WA_LockPortraitOrientation; |
|
174 | // attribute = Qt::WA_LockPortraitOrientation; | |
169 | break; |
|
175 | // break; | |
170 | case ScreenOrientationLockLandscape: |
|
176 | // case ScreenOrientationLockLandscape: | |
171 | attribute = Qt::WA_LockLandscapeOrientation; |
|
177 | // attribute = Qt::WA_LockLandscapeOrientation; | |
172 | break; |
|
178 | // break; | |
173 | default: |
|
179 | // default: | |
174 | case ScreenOrientationAuto: |
|
180 | // case ScreenOrientationAuto: | |
175 | attribute = Qt::WA_AutoOrientation; |
|
181 | // attribute = Qt::WA_AutoOrientation; | |
176 | break; |
|
182 | // break; | |
177 | #endif // QT_VERSION < 0x040702 |
|
183 | //#endif // QT_VERSION < 0x040702 | |
178 | }; |
|
184 | // }; | |
179 | setAttribute(attribute, true); |
|
185 | // setAttribute(attribute, true); | |
180 | } |
|
186 | //} | |
181 |
|
187 | |||
182 | void QmlApplicationViewer::showExpanded() |
|
188 | void QmlApplicationViewer::showExpanded() | |
183 | { |
|
189 | { |
@@ -11,7 +11,11 | |||||
11 | #ifndef QMLAPPLICATIONVIEWER_H |
|
11 | #ifndef QMLAPPLICATIONVIEWER_H | |
12 | #define QMLAPPLICATIONVIEWER_H |
|
12 | #define QMLAPPLICATIONVIEWER_H | |
13 |
|
13 | |||
14 | #include <QtDeclarative/QDeclarativeView> |
|
14 | #ifdef QT5_QUICK_1 | |
|
15 | #include <QtQuick1/QDeclarativeView> | |||
|
16 | #else | |||
|
17 | #include <QtDeclarative/QDeclarativeView> | |||
|
18 | #endif | |||
15 |
|
19 | |||
16 | class QmlApplicationViewer : public QDeclarativeView |
|
20 | class QmlApplicationViewer : public QDeclarativeView | |
17 | { |
|
21 | { | |
@@ -33,7 +37,7 public: | |||||
33 | void addImportPath(const QString &path); |
|
37 | void addImportPath(const QString &path); | |
34 |
|
38 | |||
35 | // Note that this will only have an effect on Symbian and Fremantle. |
|
39 | // Note that this will only have an effect on Symbian and Fremantle. | |
36 | void setOrientation(ScreenOrientation orientation); |
|
40 | // void setOrientation(ScreenOrientation orientation); | |
37 |
|
41 | |||
38 | void showExpanded(); |
|
42 | void showExpanded(); | |
39 |
|
43 |
@@ -27,7 +27,7 Q_DECL_EXPORT int main(int argc, char *argv[]) | |||||
27 | QScopedPointer<QApplication> app(createApplication(argc, argv)); |
|
27 | QScopedPointer<QApplication> app(createApplication(argc, argv)); | |
28 | QScopedPointer<QmlApplicationViewer> viewer(QmlApplicationViewer::create()); |
|
28 | QScopedPointer<QmlApplicationViewer> viewer(QmlApplicationViewer::create()); | |
29 |
|
29 | |||
30 | viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto); |
|
30 | // // viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto); | |
31 | viewer->setSource(QUrl("qrc:/qml/qmlchartproperties/loader.qml")); |
|
31 | viewer->setSource(QUrl("qrc:/qml/qmlchartproperties/loader.qml")); | |
32 | viewer->setRenderHint(QPainter::Antialiasing, true); |
|
32 | viewer->setRenderHint(QPainter::Antialiasing, true); | |
33 | viewer->showExpanded(); |
|
33 | viewer->showExpanded(); |
@@ -12,9 +12,15 | |||||
12 |
|
12 | |||
13 | #include <QtCore/QDir> |
|
13 | #include <QtCore/QDir> | |
14 | #include <QtCore/QFileInfo> |
|
14 | #include <QtCore/QFileInfo> | |
15 | #include <QtDeclarative/QDeclarativeComponent> |
|
15 | #ifdef QT5_QUICK_1 | |
16 |
#include <Qt |
|
16 | #include <QtQuick1/QDeclarativeComponent> | |
17 |
#include <Qt |
|
17 | #include <QtQuick1/QDeclarativeEngine> | |
|
18 | #include <QtQuick1/QDeclarativeContext> | |||
|
19 | #else | |||
|
20 | #include <QtDeclarative/QDeclarativeComponent> | |||
|
21 | #include <QtDeclarative/QDeclarativeEngine> | |||
|
22 | #include <QtDeclarative/QDeclarativeContext> | |||
|
23 | #endif | |||
18 | #include <QApplication> |
|
24 | #include <QApplication> | |
19 |
|
25 | |||
20 | #include <qplatformdefs.h> // MEEGO_EDITION_HARMATTAN |
|
26 | #include <qplatformdefs.h> // MEEGO_EDITION_HARMATTAN | |
@@ -136,48 +142,48 void QmlApplicationViewer::addImportPath(const QString &path) | |||||
136 | d->view->engine()->addImportPath(d->adjustPath(path)); |
|
142 | d->view->engine()->addImportPath(d->adjustPath(path)); | |
137 | } |
|
143 | } | |
138 |
|
144 | |||
139 | void QmlApplicationViewer::setOrientation(ScreenOrientation orientation) |
|
145 | //void QmlApplicationViewer::setOrientation(ScreenOrientation orientation) | |
140 | { |
|
146 | //{ | |
141 | #if defined(Q_OS_SYMBIAN) |
|
147 | //#if defined(Q_OS_SYMBIAN) | |
142 | // If the version of Qt on the device is < 4.7.2, that attribute won't work |
|
148 | // // If the version of Qt on the device is < 4.7.2, that attribute won't work | |
143 | if (orientation != ScreenOrientationAuto) { |
|
149 | // if (orientation != ScreenOrientationAuto) { | |
144 | const QStringList v = QString::fromAscii(qVersion()).split(QLatin1Char('.')); |
|
150 | // const QStringList v = QString::fromAscii(qVersion()).split(QLatin1Char('.')); | |
145 | if (v.count() == 3 && (v.at(0).toInt() << 16 | v.at(1).toInt() << 8 | v.at(2).toInt()) < 0x040702) { |
|
151 | // if (v.count() == 3 && (v.at(0).toInt() << 16 | v.at(1).toInt() << 8 | v.at(2).toInt()) < 0x040702) { | |
146 | qWarning("Screen orientation locking only supported with Qt 4.7.2 and above"); |
|
152 | // qWarning("Screen orientation locking only supported with Qt 4.7.2 and above"); | |
147 | return; |
|
153 | // return; | |
148 | } |
|
154 | // } | |
149 | } |
|
155 | // } | |
150 | #endif // Q_OS_SYMBIAN |
|
156 | //#endif // Q_OS_SYMBIAN | |
151 |
|
157 | |||
152 | Qt::WidgetAttribute attribute; |
|
158 | // Qt::WidgetAttribute attribute; | |
153 | switch (orientation) { |
|
159 | // switch (orientation) { | |
154 | #if QT_VERSION < 0x040702 |
|
160 | //#if QT_VERSION < 0x040702 | |
155 | // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes |
|
161 | // // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes | |
156 | case ScreenOrientationLockPortrait: |
|
162 | // case ScreenOrientationLockPortrait: | |
157 | attribute = static_cast<Qt::WidgetAttribute>(128); |
|
163 | // attribute = static_cast<Qt::WidgetAttribute>(128); | |
158 | break; |
|
164 | // break; | |
159 | case ScreenOrientationLockLandscape: |
|
165 | // case ScreenOrientationLockLandscape: | |
160 | attribute = static_cast<Qt::WidgetAttribute>(129); |
|
166 | // attribute = static_cast<Qt::WidgetAttribute>(129); | |
161 | break; |
|
167 | // break; | |
162 | default: |
|
168 | // default: | |
163 | case ScreenOrientationAuto: |
|
169 | // case ScreenOrientationAuto: | |
164 | attribute = static_cast<Qt::WidgetAttribute>(130); |
|
170 | // attribute = static_cast<Qt::WidgetAttribute>(130); | |
165 | break; |
|
171 | // break; | |
166 | #else // QT_VERSION < 0x040702 |
|
172 | //#else // QT_VERSION < 0x040702 | |
167 | case ScreenOrientationLockPortrait: |
|
173 | // case ScreenOrientationLockPortrait: | |
168 | attribute = Qt::WA_LockPortraitOrientation; |
|
174 | // attribute = Qt::WA_LockPortraitOrientation; | |
169 | break; |
|
175 | // break; | |
170 | case ScreenOrientationLockLandscape: |
|
176 | // case ScreenOrientationLockLandscape: | |
171 | attribute = Qt::WA_LockLandscapeOrientation; |
|
177 | // attribute = Qt::WA_LockLandscapeOrientation; | |
172 | break; |
|
178 | // break; | |
173 | default: |
|
179 | // default: | |
174 | case ScreenOrientationAuto: |
|
180 | // case ScreenOrientationAuto: | |
175 | attribute = Qt::WA_AutoOrientation; |
|
181 | // attribute = Qt::WA_AutoOrientation; | |
176 | break; |
|
182 | // break; | |
177 | #endif // QT_VERSION < 0x040702 |
|
183 | //#endif // QT_VERSION < 0x040702 | |
178 | }; |
|
184 | // }; | |
179 | setAttribute(attribute, true); |
|
185 | // setAttribute(attribute, true); | |
180 | } |
|
186 | //} | |
181 |
|
187 | |||
182 | void QmlApplicationViewer::showExpanded() |
|
188 | void QmlApplicationViewer::showExpanded() | |
183 | { |
|
189 | { |
@@ -11,7 +11,11 | |||||
11 | #ifndef QMLAPPLICATIONVIEWER_H |
|
11 | #ifndef QMLAPPLICATIONVIEWER_H | |
12 | #define QMLAPPLICATIONVIEWER_H |
|
12 | #define QMLAPPLICATIONVIEWER_H | |
13 |
|
13 | |||
14 | #include <QtDeclarative/QDeclarativeView> |
|
14 | #ifdef QT5_QUICK_1 | |
|
15 | #include <QtQuick1/QDeclarativeView> | |||
|
16 | #else | |||
|
17 | #include <QtDeclarative/QDeclarativeView> | |||
|
18 | #endif | |||
15 |
|
19 | |||
16 | class QmlApplicationViewer : public QDeclarativeView |
|
20 | class QmlApplicationViewer : public QDeclarativeView | |
17 | { |
|
21 | { | |
@@ -33,7 +37,7 public: | |||||
33 | void addImportPath(const QString &path); |
|
37 | void addImportPath(const QString &path); | |
34 |
|
38 | |||
35 | // Note that this will only have an effect on Symbian and Fremantle. |
|
39 | // Note that this will only have an effect on Symbian and Fremantle. | |
36 | void setOrientation(ScreenOrientation orientation); |
|
40 | // void setOrientation(ScreenOrientation orientation); | |
37 |
|
41 | |||
38 | void showExpanded(); |
|
42 | void showExpanded(); | |
39 |
|
43 |
General Comments 0
You need to be logged in to leave comments.
Login now