[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [marble/qt5] src: don't use QDeclarative typedefs in headers
From:       Michael Zanetti <mzanetti () kde ! org>
Date:       2013-08-25 14:27:11
Message-ID: E1VDbHb-0004JQ-35 () scm ! kde ! org
[Download RAW message or body]

Git commit e7898acfb8f044d8b945023551c40c301b962006 by Michael Zanetti.
Committed on 25/08/2013 at 14:26.
Pushed by mzanetti into branch 'qt5'.

don't use QDeclarative typedefs in headers

M  +4    -1    src/lib/AbstractDataPlugin.h
M  +4    -0    src/plugins/declarative/DeclarativeDataPlugin.cpp
M  +10   -0    src/plugins/declarative/DeclarativeDataPlugin.h
M  +2    -1    src/plugins/declarative/MarbleDeclarativePlugin.cpp
M  +10   -3    src/plugins/declarative/MarbleDeclarativePlugin.h
M  +4    -0    src/plugins/declarative/MarbleDeclarativeWidget.cpp
M  +4    -1    src/plugins/declarative/MarbleDeclarativeWidget.h
M  +3    -0    src/plugins/declarative/Search.cpp
M  +16   -3    src/plugins/declarative/Search.h

http://commits.kde.org/marble/e7898acfb8f044d8b945023551c40c301b962006

diff --git a/src/lib/AbstractDataPlugin.h b/src/lib/AbstractDataPlugin.h
index 0e0f1a1..555ffa9 100644
--- a/src/lib/AbstractDataPlugin.h
+++ b/src/lib/AbstractDataPlugin.h
@@ -17,7 +17,6 @@
 
 #if QT_VERSION < 0x050000
 class QDeclarativeComponent;
-typedef QDeclarativeComponent QQmlComponent;
 #else
 class QQmlComponent;
 #endif
@@ -117,7 +116,11 @@ class MARBLE_EXPORT AbstractDataPlugin : public RenderPlugin
      */
     virtual RenderType renderType() const;
 
+#if QT_VERSION < 0x050000
+    void setDelegate( QDeclarativeComponent* delegate, QGraphicsItem* parent );
+#else
     void setDelegate( QQmlComponent* delegate, QGraphicsItem* parent );
+#endif
 
     /** Convenience method to set the favorite item state on the current model */
     void setFavoriteItemsOnly( bool favoriteOnly );
diff --git a/src/plugins/declarative/DeclarativeDataPlugin.cpp \
b/src/plugins/declarative/DeclarativeDataPlugin.cpp index 902e3ed..93b87b3 100644
--- a/src/plugins/declarative/DeclarativeDataPlugin.cpp
+++ b/src/plugins/declarative/DeclarativeDataPlugin.cpp
@@ -24,6 +24,10 @@
 #include <QScriptValue>
 #include <QScriptValueIterator>
 
+#if QT_VERSION < 0x050000
+  typedef QDeclarativeComponent QQmlComponent;
+#endif
+
 using namespace Marble;
 
 class DeclarativeDataPluginPrivate {
diff --git a/src/plugins/declarative/DeclarativeDataPlugin.h \
b/src/plugins/declarative/DeclarativeDataPlugin.h index b5f02b0..4d2de1f 100644
--- a/src/plugins/declarative/DeclarativeDataPlugin.h
+++ b/src/plugins/declarative/DeclarativeDataPlugin.h
@@ -37,7 +37,11 @@ class DeclarativeDataPlugin: public Marble::AbstractDataPlugin
     Q_PROPERTY( QStringList pluginAuthors READ authors WRITE setAuthors NOTIFY \
                authorsChanged )
     Q_PROPERTY( QString aboutDataText READ aboutDataText WRITE setAboutDataText \
                NOTIFY aboutDataTextChanged )
     Q_PROPERTY( QVariant model READ declarativeModel WRITE setDeclarativeModel \
NOTIFY declarativeModelChanged ) +#if QT_VERSION < 0x050000
+    Q_PROPERTY( QDeclarativeComponent* delegate READ delegate WRITE setDelegate \
NOTIFY delegateChanged ) +#else
     Q_PROPERTY( QQmlComponent* delegate READ delegate WRITE setDelegate NOTIFY \
delegateChanged ) +#endif
 
 public:
     Marble::RenderPlugin* newInstance( const Marble::MarbleModel *marbleModel ) \
const; @@ -86,9 +90,15 @@ public:
 
     virtual QIcon icon() const;
 
+#if QT_VERSION < 0x050000
+    QDeclarativeComponent *delegate();
+
+    void setDelegate( QDeclarativeComponent* delegate );
+#else
     QQmlComponent *delegate();
 
     void setDelegate( QQmlComponent* delegate );
+#endif
 
     QVariant declarativeModel();
 
diff --git a/src/plugins/declarative/MarbleDeclarativePlugin.cpp \
b/src/plugins/declarative/MarbleDeclarativePlugin.cpp index 4e71843..e30966c 100644
--- a/src/plugins/declarative/MarbleDeclarativePlugin.cpp
+++ b/src/plugins/declarative/MarbleDeclarativePlugin.cpp
@@ -35,7 +35,8 @@
 #if QT_VERSION < 0x050000
   #include <qdeclarative.h>
   #include <QDeclarativeEngine>
-  typedef QQmlEngine QDeclarativeEngine;
+  typedef QDeclarativeEngine QQmlEngine;
+  typedef QDeclarativeComponent QQmlComponent;
 #else
   #include <QtQml/qqml.h>
   #include <QQmlEngine>
diff --git a/src/plugins/declarative/MarbleDeclarativePlugin.h \
b/src/plugins/declarative/MarbleDeclarativePlugin.h index 02793ff..49ec58c 100644
--- a/src/plugins/declarative/MarbleDeclarativePlugin.h
+++ b/src/plugins/declarative/MarbleDeclarativePlugin.h
@@ -15,8 +15,6 @@
 
 #if QT_VERSION < 0x050000
   #include <QDeclarativeExtensionPlugin>
-  typedef QDeclarativeExtensionPlugin QQmlExtensionPlugin;
-  typedef QDeclarativeEngine QQmlEngine;
 #else
   #include <QQmlExtensionPlugin>
 #endif
@@ -25,16 +23,25 @@
   * Registers MarbleWidget, MarbleRunnerManager and MarbleThemeManager
   * as QQml extensions for use in QML.
   */
+#if QT_VERSION < 0x050000
+class MarbleDeclarativePlugin : public QDeclarativeExtensionPlugin
+{
+#else
 class MarbleDeclarativePlugin : public QQmlExtensionPlugin
 {
-    Q_OBJECT
     Q_PLUGIN_METADATA( IID "org.kde.edu.marble.MarbleDeclarativePlugin" )
+#endif
+    Q_OBJECT
 public:
     /** Overriding QQmlExtensionPlugin to register types */
     virtual void registerTypes( const char *uri );
 
     /** Overriding QQmlExtensionPlugin to register image provider */
+#if QT_VERSION < 0x050000
+    void initializeEngine( QDeclarativeEngine *engine, const char *);
+#else
     void initializeEngine( QQmlEngine *engine, const char *);
+#endif
 };
 
 #endif
diff --git a/src/plugins/declarative/MarbleDeclarativeWidget.cpp \
b/src/plugins/declarative/MarbleDeclarativeWidget.cpp index 44e16b7..10b2321 100644
--- a/src/plugins/declarative/MarbleDeclarativeWidget.cpp
+++ b/src/plugins/declarative/MarbleDeclarativeWidget.cpp
@@ -36,6 +36,10 @@
 #include <QSettings>
 #include <QApplication>
 
+#if QT_VERSION < 0x050000
+  typedef QDeclarativeComponent QQmlComponent;
+#endif
+
 MarbleWidget::MarbleWidget( QGraphicsItem *parent , Qt::WindowFlags flags ) :
     QGraphicsProxyWidget( parent, flags ),
     m_marbleWidget( new Marble::MarbleWidget ),
diff --git a/src/plugins/declarative/MarbleDeclarativeWidget.h \
b/src/plugins/declarative/MarbleDeclarativeWidget.h index 4ae9dbf..7eabe3d 100644
--- a/src/plugins/declarative/MarbleDeclarativeWidget.h
+++ b/src/plugins/declarative/MarbleDeclarativeWidget.h
@@ -22,7 +22,6 @@
 #include <QStandardItemModel>
 #if QT_VERSION < 0x050000
   #include <QtDeclarative/qdeclarative.h>
-  typedef QDeclarativeComponent QQmlComponent;
 #else
   #include <QtQml/qqml.h>
 #endif
@@ -207,7 +206,11 @@ public Q_SLOTS:
 
     void downloadArea( int topTileLevel, int bottomTileLevel );
 
+#if QT_VERSION < 0x050000
+    void setDataPluginDelegate( const QString &plugin, QDeclarativeComponent* \
delegate ); +#else
     void setDataPluginDelegate( const QString &plugin, QQmlComponent* delegate );
+#endif
 
 protected:
     virtual bool event ( QEvent * event );
diff --git a/src/plugins/declarative/Search.cpp b/src/plugins/declarative/Search.cpp
index 0d37ec4..a7eb9ba 100644
--- a/src/plugins/declarative/Search.cpp
+++ b/src/plugins/declarative/Search.cpp
@@ -17,6 +17,9 @@
 
 #if QT_VERSION < 0x050000
   #include <QDeclarativeContext>
+  typedef QDeclarativeItem QQuickItem;
+  typedef QDeclarativeContext QQmlContext;
+  typedef QDeclarativeComponent QQmlComponent;
 #else
   #include <QQmlContext>
 #endif
diff --git a/src/plugins/declarative/Search.h b/src/plugins/declarative/Search.h
index 57e5cde..e7ee9b9 100644
--- a/src/plugins/declarative/Search.h
+++ b/src/plugins/declarative/Search.h
@@ -16,9 +16,6 @@
   #include <QtDeclarative/qdeclarative.h>
   #include <QDeclarativeComponent>
   #include <QDeclarativeItem>
-  typedef QDeclarativeItem QQuickItem;
-  typedef QDeclarativeComponent QQmlComponent;
-  typedef QDeclarativeContext QQmlContext;
 #else
   #include <QtQml/qqml.h>
   #include <QQuickItem>
@@ -37,7 +34,11 @@ class Search : public QObject
     Q_OBJECT
 
     Q_PROPERTY( MarbleWidget* map READ map WRITE setMap NOTIFY mapChanged )
+#if QT_VERSION < 0x050000
+    Q_PROPERTY( QDeclarativeComponent* placemarkDelegate READ placemarkDelegate \
WRITE setPlacemarkDelegate NOTIFY placemarkDelegateChanged ) +#else
     Q_PROPERTY( QQmlComponent* placemarkDelegate READ placemarkDelegate WRITE \
setPlacemarkDelegate NOTIFY placemarkDelegateChanged ) +#endif
 
 public:
     explicit Search( QObject* parent = 0 );
@@ -46,9 +47,15 @@ public:
 
     void setMap( MarbleWidget* widget );
 
+#if QT_VERSION < 0x050000
+    QDeclarativeComponent* placemarkDelegate();
+
+    void setPlacemarkDelegate( QDeclarativeComponent* delegate );
+#else
     QQmlComponent* placemarkDelegate();
 
     void setPlacemarkDelegate( QQmlComponent* delegate );
+#endif
 
 Q_SIGNALS:
     void mapChanged();
@@ -83,9 +90,15 @@ private:
     /** Search result */
     Marble::MarblePlacemarkModel *m_searchResult;
 
+#if QT_VERSION < 0x050000
+    QDeclarativeComponent* m_placemarkDelegate;
+
+    QMap<int,QDeclarativeItem*> m_placemarks;
+#else
     QQmlComponent* m_placemarkDelegate;
 
     QMap<int,QQuickItem*> m_placemarks;
+#endif
 };
 
 #endif


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic