##// END OF EJS Templates
Workaround for version check flag
Jani Honkonen -
r3:c3678819f924
parent child
Show More
@@ -1,7 +1,7
1 #include "declarativechart.h"
1 #include "declarativechart.h"
2 #include <QPainter>
2 #include <QPainter>
3
3
4 #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
4 #ifndef QTQUICK2
5 DeclarativeChart::DeclarativeChart(QDeclarativeItem *parent)
5 DeclarativeChart::DeclarativeChart(QDeclarativeItem *parent)
6 : QDeclarativeItem(parent)
6 : QDeclarativeItem(parent)
7 {
7 {
@@ -16,7 +16,7 DeclarativeChart::DeclarativeChart(QQuickItem *parent)
16 }
16 }
17 #endif
17 #endif
18
18
19 #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
19 #ifndef QTQUICK2
20 void DeclarativeChart::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
20 void DeclarativeChart::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
21 #else
21 #else
22 void DeclarativeChart::paint(QPainter *painter)
22 void DeclarativeChart::paint(QPainter *painter)
@@ -2,7 +2,7
2 #define DECLARATIVECHART_H
2 #define DECLARATIVECHART_H
3
3
4 #include <QtCore/QtGlobal>
4 #include <QtCore/QtGlobal>
5 #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
5 #ifndef QTQUICK2
6 #include <QDeclarativeItem>
6 #include <QDeclarativeItem>
7 #else
7 #else
8 #include <QtQuick/QQuickPaintedItem>
8 #include <QtQuick/QQuickPaintedItem>
@@ -10,7 +10,7
10 #include <QColor>
10 #include <QColor>
11 #include "../src/chart.h"
11 #include "../src/chart.h"
12
12
13 #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
13 #ifndef QTQUICK2
14 class DeclarativeChart : public QDeclarativeItem, public Chart
14 class DeclarativeChart : public QDeclarativeItem, public Chart
15 #else
15 #else
16 class DeclarativeChart : public QQuickPaintedItem, public Chart
16 class DeclarativeChart : public QQuickPaintedItem, public Chart
@@ -20,13 +20,13 class DeclarativeChart : public QQuickPaintedItem, public Chart
20 Q_PROPERTY(QColor color READ color WRITE setColor)
20 Q_PROPERTY(QColor color READ color WRITE setColor)
21
21
22 public:
22 public:
23 #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
23 #ifndef QTQUICK2
24 DeclarativeChart(QDeclarativeItem *parent = 0);
24 DeclarativeChart(QDeclarativeItem *parent = 0);
25 #else
25 #else
26 DeclarativeChart(QQuickItem *parent = 0);
26 DeclarativeChart(QQuickItem *parent = 0);
27 #endif
27 #endif
28
28
29 #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
29 #ifndef QTQUICK2
30 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
30 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
31 #else
31 #else
32 void paint(QPainter *painter);
32 void paint(QPainter *painter);
@@ -4,6 +4,10 TARGET = qmlchartplugin
4 CONFIG += qt plugin
4 CONFIG += qt plugin
5 QT += declarative
5 QT += declarative
6
6
7 contains($$QT_MAJOR_VERSION, 5) {
8 DEFINES += QTQUICK2
9 }
10
7 OBJECTS_DIR = tmp
11 OBJECTS_DIR = tmp
8 MOC_DIR = tmp
12 MOC_DIR = tmp
9
13
General Comments 0
You need to be logged in to leave comments. Login now