From 21c113d296ef0f0cfd849832e9f850b6baee249c 2016-02-03 11:31:13 From: Miikka Heikkinen Date: 2016-02-03 11:31:13 Subject: [PATCH] No longer automatically disable QDateTimeAxis on ARM platforms QDateTimeAxis is now only disabled on platforms that define qreal as float. Change-Id: I08d393d328c972d74b27bd218e4cd01e844800c9 Reviewed-by: Tomi Korpipää Reviewed-by: Mika Salmela Reviewed-by: Miikka Heikkinen --- diff --git a/examples/charts/charts.pro b/examples/charts/charts.pro index 3f463e4..5caa03c 100644 --- a/examples/charts/charts.pro +++ b/examples/charts/charts.pro @@ -59,7 +59,7 @@ contains(QT_CONFIG, opengl) { message("OpenGL not available. Some examples are disabled.") } -!linux-arm*: { +!contains(QT_COORD_TYPE, float): { SUBDIRS += \ datetimeaxis } diff --git a/src/charts/axis/axis.pri b/src/charts/axis/axis.pri index 6f706aa..445782c 100644 --- a/src/charts/axis/axis.pri +++ b/src/charts/axis/axis.pri @@ -81,7 +81,7 @@ PRIVATE_HEADERS += \ $$PWD/categoryaxis/polarchartcategoryaxisangular_p.h \ $$PWD/categoryaxis/polarchartcategoryaxisradial_p.h -!linux-arm*: { +!contains(QT_COORD_TYPE, float): { INCLUDEPATH += \ $$PWD/datetimeaxis diff --git a/src/charts/axis/datetimeaxis/qdatetimeaxis.cpp b/src/charts/axis/datetimeaxis/qdatetimeaxis.cpp index ad7fbff..00c4304 100644 --- a/src/charts/axis/datetimeaxis/qdatetimeaxis.cpp +++ b/src/charts/axis/datetimeaxis/qdatetimeaxis.cpp @@ -49,7 +49,7 @@ QT_CHARTS_BEGIN_NAMESPACE There are also other limitiation related to QDateTime. Please refer to QDateTime documentation. QDateTimeAxis can be setup to show axis line with tick marks, grid lines and shades. - Note: QDateTimeAxis is disabled on ARM architecture. + Note: QDateTimeAxis is disabled on platforms that define qreal as float. \image api_datatime_axis.png diff --git a/src/charts/chartdataset.cpp b/src/charts/chartdataset.cpp index 10a46fe..33857b0 100644 --- a/src/charts/chartdataset.cpp +++ b/src/charts/chartdataset.cpp @@ -51,7 +51,7 @@ #include #include -#ifndef QT_ON_ARM +#ifndef QT_QREAL_IS_FLOAT #include #endif @@ -361,7 +361,7 @@ void ChartDataSet::createAxes(QAbstractAxis::AxisTypes type, Qt::Orientation ori case QAbstractAxis::AxisTypeCategory: axis = new QCategoryAxis(this); break; -#ifndef Q_WS_QWS +#ifndef QT_QREAL_IS_FLOAT case QAbstractAxis::AxisTypeDateTime: axis = new QDateTimeAxis(this); break; diff --git a/src/charts/charts.pro b/src/charts/charts.pro index 427432b..30546fd 100644 --- a/src/charts/charts.pro +++ b/src/charts/charts.pro @@ -5,6 +5,8 @@ TARGET = QtCharts message($$QT_CONFIG) QT = core gui widgets DEFINES += QT_CHARTS_LIBRARY +contains(QT_COORD_TYPE, float): DEFINES += QT_QREAL_IS_FLOAT + # Fix exports in static builds for applications linking charts module static: MODULE_DEFINES += QT_CHARTS_STATICLIB diff --git a/src/chartsqml2/chartsqml2.pro b/src/chartsqml2/chartsqml2.pro index 5df0194..fae7dc2 100644 --- a/src/chartsqml2/chartsqml2.pro +++ b/src/chartsqml2/chartsqml2.pro @@ -3,6 +3,7 @@ TARGET = qtchartsqml2 QT += qml quick QT += charts charts-private TARGETPATH = QtCharts +contains(QT_COORD_TYPE, float): DEFINES += QT_QREAL_IS_FLOAT IMPORT_VERSION = $$MODULE_VERSION diff --git a/src/chartsqml2/chartsqml2_plugin.cpp b/src/chartsqml2/chartsqml2_plugin.cpp index 67eebd8..6cf2f9c 100644 --- a/src/chartsqml2/chartsqml2_plugin.cpp +++ b/src/chartsqml2/chartsqml2_plugin.cpp @@ -57,7 +57,7 @@ #include #include #include -#ifndef QT_ON_ARM +#ifndef QT_QREAL_IS_FLOAT #include #endif #include @@ -87,7 +87,9 @@ QML_DECLARE_TYPE(QAbstractAxis) QML_DECLARE_TYPE(QValueAxis) QML_DECLARE_TYPE(QBarCategoryAxis) QML_DECLARE_TYPE(QCategoryAxis) -QML_DECLARE_TYPE(QDateTimeAxis) +#ifndef QT_QREAL_IS_FLOAT + QML_DECLARE_TYPE(QDateTimeAxis) +#endif QML_DECLARE_TYPE(QLogValueAxis) QML_DECLARE_TYPE(QLegend) @@ -207,7 +209,7 @@ public: qmlRegisterType(uri, 1, 1, "PieSeries"); qmlRegisterType(uri, 1, 1, "BarSet"); qmlRegisterType(uri, 1, 1, "ValueAxis"); -#ifndef QT_ON_ARM +#ifndef QT_QREAL_IS_FLOAT qmlRegisterType(uri, 1, 1, "DateTimeAxis"); #endif qmlRegisterType(uri, 1, 1, "CategoryAxis"); @@ -271,7 +273,7 @@ public: qmlRegisterType(uri, 2, 0, "HBarModelMapper"); qmlRegisterType(uri, 2, 0, "VBarModelMapper"); qmlRegisterType(uri, 2, 0, "ValueAxis"); -#ifndef QT_ON_ARM +#ifndef QT_QREAL_IS_FLOAT qmlRegisterType(uri, 2, 0, "DateTimeAxis"); #endif qmlRegisterType(uri, 2, 0, "CategoryAxis"); diff --git a/src/chartsqml2/declarativechart.cpp b/src/chartsqml2/declarativechart.cpp index 25fb16c..3362daf 100644 --- a/src/chartsqml2/declarativechart.cpp +++ b/src/chartsqml2/declarativechart.cpp @@ -50,7 +50,7 @@ #include #include -#ifndef QT_ON_ARM +#ifndef QT_QREAL_IS_FLOAT #include #endif @@ -1149,7 +1149,7 @@ QAbstractAxis *DeclarativeChart::defaultAxis(Qt::Orientation orientation, QAbstr return new QBarCategoryAxis(this); case QAbstractAxis::AxisTypeCategory: return new QCategoryAxis(this); -#ifndef QT_ON_ARM +#ifndef QT_QREAL_IS_FLOAT case QAbstractAxis::AxisTypeDateTime: return new QDateTimeAxis(this); #endif diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 7ed84cb..e8cad75 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -25,7 +25,7 @@ SUBDIRS += \ qlegend \ cmake -!linux-arm*: { +!contains(QT_COORD_TYPE, float): { SUBDIRS += \ qdatetimeaxis } diff --git a/tests/auto/chartdataset/chartdataset.pro b/tests/auto/chartdataset/chartdataset.pro index 994532a..754f3e9 100644 --- a/tests/auto/chartdataset/chartdataset.pro +++ b/tests/auto/chartdataset/chartdataset.pro @@ -3,5 +3,6 @@ } QT += charts-private +contains(QT_COORD_TYPE, float): DEFINES += QT_QREAL_IS_FLOAT SOURCES += tst_chartdataset.cpp diff --git a/tests/auto/chartdataset/tst_chartdataset.cpp b/tests/auto/chartdataset/tst_chartdataset.cpp index 12652d6..fc1ac1d 100644 --- a/tests/auto/chartdataset/tst_chartdataset.cpp +++ b/tests/auto/chartdataset/tst_chartdataset.cpp @@ -32,7 +32,7 @@ #include #include #include -#ifndef QT_ON_ARM +#ifndef QT_QREAL_IS_FLOAT #include #endif #include @@ -208,14 +208,14 @@ void tst_ChartDataSet::addAxis_data() QAbstractAxis* value = new QValueAxis(this); QAbstractAxis* category = new QCategoryAxis(this); QAbstractAxis* barcategory = new QBarCategoryAxis(this); -#ifndef Q_WS_QWS +#ifndef QT_QREAL_IS_FLOAT QAbstractAxis* datetime = new QDateTimeAxis(this); #endif QTest::newRow("value") << value; QTest::newRow("category") << category; QTest::newRow("barcategory") << barcategory; -#ifndef Q_WS_QWS +#ifndef QT_QREAL_IS_FLOAT QTest::newRow("datetime") << datetime; #endif } diff --git a/tests/auto/qml/qml.pro b/tests/auto/qml/qml.pro index f116195..c7b808d 100644 --- a/tests/auto/qml/qml.pro +++ b/tests/auto/qml/qml.pro @@ -3,3 +3,4 @@ } SOURCES += tst_qml.cpp QT += qml quick +contains(QT_COORD_TYPE, float): DEFINES += QT_QREAL_IS_FLOAT diff --git a/tests/auto/qml/tst_qml.cpp b/tests/auto/qml/tst_qml.cpp index fcbef8c..b397f3d 100644 --- a/tests/auto/qml/tst_qml.cpp +++ b/tests/auto/qml/tst_qml.cpp @@ -140,7 +140,7 @@ void tst_qml::checkPlugin_data() QTest::newRow("HBarModelMapper") << imports_1_1() + "HBarModelMapper{}"; QTest::newRow("VBarModelMapper") << imports_1_1() + "VBarModelMapper{}"; QTest::newRow("ValueAxis") << imports_1_1() + "ValueAxis{}"; -#ifndef QT_ON_ARM +#ifndef QT_QREAL_IS_FLOAT QTest::newRow("DateTimeAxis") << imports_1_1() + "DateTimeAxis{}"; #endif QTest::newRow("CategoryAxis") << imports_1_1() + "CategoryAxis{}"; @@ -176,7 +176,7 @@ void tst_qml::checkPlugin_data() QTest::newRow("HBarModelMapper_2_0") << imports_2_0() + "HBarModelMapper{}"; QTest::newRow("VBarModelMapper_2_0") << imports_2_0() + "VBarModelMapper{}"; QTest::newRow("ValueAxis_2_0") << imports_2_0() + "ValueAxis{}"; -#ifndef QT_ON_ARM +#ifndef QT_QREAL_IS_FLOAT QTest::newRow("DateTimeAxis_2_0") << imports_2_0() + "DateTimeAxis{}"; #endif QTest::newRow("CategoryAxis_2_0") << imports_2_0() + "CategoryAxis{}"; diff --git a/tests/manual/chartviewer/charts/charts.pri b/tests/manual/chartviewer/charts/charts.pri index 5bef427..17e3d4e 100644 --- a/tests/manual/chartviewer/charts/charts.pri +++ b/tests/manual/chartviewer/charts/charts.pri @@ -44,7 +44,7 @@ SOURCES += \ $$PWD/domain/scatterlogxy.cpp \ $$PWD/domain/scatterxlogy.cpp -!linux-arm*: { +!contains(QT_COORD_TYPE, float): { SOURCES += \ $$PWD/axis/datetimeaxisx.cpp \ $$PWD/axis/datetimeaxisy.cpp