From c3678819f9248dda62ec1883aca96d99df22069d 2012-01-03 15:29:22 From: Jani Honkonen Date: 2012-01-03 15:29:22 Subject: [PATCH] Workaround for version check flag --- diff --git a/qmlplugin/declarativechart.cpp b/qmlplugin/declarativechart.cpp index 41d471c..5fcedc5 100644 --- a/qmlplugin/declarativechart.cpp +++ b/qmlplugin/declarativechart.cpp @@ -1,7 +1,7 @@ #include "declarativechart.h" #include -#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) +#ifndef QTQUICK2 DeclarativeChart::DeclarativeChart(QDeclarativeItem *parent) : QDeclarativeItem(parent) { @@ -16,7 +16,7 @@ DeclarativeChart::DeclarativeChart(QQuickItem *parent) } #endif -#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) +#ifndef QTQUICK2 void DeclarativeChart::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) #else void DeclarativeChart::paint(QPainter *painter) diff --git a/qmlplugin/declarativechart.h b/qmlplugin/declarativechart.h index e21eba5..89d7f8b 100644 --- a/qmlplugin/declarativechart.h +++ b/qmlplugin/declarativechart.h @@ -2,7 +2,7 @@ #define DECLARATIVECHART_H #include -#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) +#ifndef QTQUICK2 #include #else #include @@ -10,7 +10,7 @@ #include #include "../src/chart.h" -#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) +#ifndef QTQUICK2 class DeclarativeChart : public QDeclarativeItem, public Chart #else class DeclarativeChart : public QQuickPaintedItem, public Chart @@ -20,13 +20,13 @@ class DeclarativeChart : public QQuickPaintedItem, public Chart Q_PROPERTY(QColor color READ color WRITE setColor) public: -#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) +#ifndef QTQUICK2 DeclarativeChart(QDeclarativeItem *parent = 0); #else DeclarativeChart(QQuickItem *parent = 0); #endif -#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) +#ifndef QTQUICK2 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); #else void paint(QPainter *painter); diff --git a/qmlplugin/qmlplugin.pro b/qmlplugin/qmlplugin.pro index 58208e2..4baacc3 100644 --- a/qmlplugin/qmlplugin.pro +++ b/qmlplugin/qmlplugin.pro @@ -4,6 +4,10 @@ TARGET = qmlchartplugin CONFIG += qt plugin QT += declarative +contains($$QT_MAJOR_VERSION, 5) { + DEFINES += QTQUICK2 +} + OBJECTS_DIR = tmp MOC_DIR = tmp