[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [marble] src: API change: reflect in the API that MarbleGraphicsItems are now 2D objects
From: Bernhard Beschow <bbeschow () cs ! tu-berlin ! de>
Date: 2012-08-06 17:34:41
Message-ID: 20120806173441.B1D56A60A6 () git ! kde ! org
[Download RAW message or body]
Git commit b8d7cf56ad6282dcf66254c5cf229b6c4adfe0ae by Bernhard Beschow.
Committed on 01/08/2012 at 18:09.
Pushed by beschow into branch 'master'.
API change: reflect in the API that MarbleGraphicsItems are now 2D objects
== Changes ==
All painting methods of MarbleGraphicsItem and subclasses now take a QPainter rather \
than a GeoPainter, which is sufficient for 2D items. The renderPosition and \
GeoSceneLayer parameters have been removed from all these methods as well. The \
paint() and paintContent() methods, which paint an item in item coordinates, don't \
take a ViewportParams parameter any more.
== Motivation ==
* using plain 2D API rather than GeoPainter avoids possible side effects of \
GeoPainter such as repeating in x-direction, which could disturb \
caching
* plain 2D items also shouldn't depend on the current viewport, especially on the \
projection Reacting to viewport changes is currently only possible by subclassing \
AbstractFloatItem and by reimplementing changeViewport(), where this method is called \
always before paint().
* the renderPosition and GeoSceneLayer parameters were never used and were probably \
overdesigned
REVIEW: 105828
M +4 -1 src/lib/AbstractDataPlugin.cpp
M +5 -1 src/lib/AbstractFloatItem.cpp
M +6 -11 src/lib/graphicsview/FrameGraphicsItem.cpp
M +3 -5 src/lib/graphicsview/FrameGraphicsItem.h
M +3 -11 src/lib/graphicsview/LabelGraphicsItem.cpp
M +1 -2 src/lib/graphicsview/LabelGraphicsItem.h
M +8 -13 src/lib/graphicsview/MarbleGraphicsItem.cpp
M +3 -6 src/lib/graphicsview/MarbleGraphicsItem.h
M +0 -1 src/lib/graphicsview/MarbleGraphicsItem_p.h
M +2 -7 src/lib/graphicsview/WidgetGraphicsItem.cpp
M +1 -2 src/lib/graphicsview/WidgetGraphicsItem.h
M +1 -3 src/lib/graphicsview/WidgetGraphicsItem_p.h
M +2 -9 src/plugins/render/compass/CompassFloatItem.cpp
M +1 -2 src/plugins/render/compass/CompassFloatItem.h
M +2 -7 src/plugins/render/earthquake/EarthquakeItem.cpp
M +1 -2 src/plugins/render/earthquake/EarthquakeItem.h
M +2 -9 src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp
M +1 -2 src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.h
M +4 -1 src/plugins/render/elevationprofilemarker/ElevationProfileMarker.cpp
M +2 -9 src/plugins/render/mapscale/MapScaleFloatItem.cpp
M +1 -2 src/plugins/render/mapscale/MapScaleFloatItem.h
M +5 -8 src/plugins/render/opendesktop/OpenDesktopItem.cpp
M +1 -1 src/plugins/render/opendesktop/OpenDesktopItem.h
M +2 -7 src/plugins/render/overviewmap/OverviewMap.cpp
M +1 -2 src/plugins/render/overviewmap/OverviewMap.h
M +2 -7 src/plugins/render/postalcode/PostalCodeItem.cpp
M +1 -2 src/plugins/render/postalcode/PostalCodeItem.h
M +2 -7 src/plugins/render/progress/ProgressFloatItem.cpp
M +1 -2 src/plugins/render/progress/ProgressFloatItem.h
M +2 -7 src/plugins/render/wikipedia/WikipediaItem.cpp
M +1 -2 src/plugins/render/wikipedia/WikipediaItem.h
http://commits.kde.org/marble/b8d7cf56ad6282dcf66254c5cf229b6c4adfe0ae
diff --git a/src/lib/AbstractDataPlugin.cpp b/src/lib/AbstractDataPlugin.cpp
index cee18e4..b85d7c9 100644
--- a/src/lib/AbstractDataPlugin.cpp
+++ b/src/lib/AbstractDataPlugin.cpp
@@ -74,6 +74,9 @@ QStringList AbstractDataPlugin::renderPosition() const
bool AbstractDataPlugin::render( GeoPainter *painter, ViewportParams *viewport,
const QString& renderPos, GeoSceneLayer * layer)
{
+ Q_UNUSED( renderPos )
+ Q_UNUSED( layer )
+
if ( ( 0 == d->m_model ) || !isInitialized() ) {
return true;
}
@@ -85,7 +88,7 @@ bool AbstractDataPlugin::render( GeoPainter *painter, \
ViewportParams *viewport,
// Paint the most important item at last
for( int i = items.size() - 1; i >= 0; --i ) {
- items.at( i )->paintEvent( painter, viewport, renderPos, layer );
+ items.at( i )->paintEvent( painter, viewport );
}
painter->restore();
diff --git a/src/lib/AbstractFloatItem.cpp b/src/lib/AbstractFloatItem.cpp
index e54b72f..15ceebb 100644
--- a/src/lib/AbstractFloatItem.cpp
+++ b/src/lib/AbstractFloatItem.cpp
@@ -18,6 +18,7 @@
// Marble
#include "DialogConfigurationInterface.h"
+#include "GeoPainter.h"
#include "MarbleDebug.h"
namespace Marble
@@ -180,13 +181,16 @@ void AbstractFloatItem::changeViewport( ViewportParams \
*viewport ) bool AbstractFloatItem::render( GeoPainter *painter, ViewportParams \
*viewport, const QString& renderPos, GeoSceneLayer * layer )
{
+ Q_UNUSED( renderPos )
+ Q_UNUSED( layer )
+
if ( !enabled() || !visible() ) {
return true;
}
changeViewport( viewport ); // may invalidate graphics item's cache
- paintEvent( painter, viewport, renderPos, layer );
+ paintEvent( painter, viewport );
return true;
}
diff --git a/src/lib/graphicsview/FrameGraphicsItem.cpp \
b/src/lib/graphicsview/FrameGraphicsItem.cpp index f91281f..0e0cd9b 100644
--- a/src/lib/graphicsview/FrameGraphicsItem.cpp
+++ b/src/lib/graphicsview/FrameGraphicsItem.cpp
@@ -13,11 +13,11 @@
#include "FrameGraphicsItem_p.h"
// Marble
-#include "GeoPainter.h"
+#include "MarbleDebug.h"
// Qt
-#include "MarbleDebug.h"
#include <QtCore/QSizeF>
+#include <QtGui/QPainter>
using namespace Marble;
@@ -220,7 +220,7 @@ QPainterPath FrameGraphicsItem::backgroundShape() const
return path;
}
-void FrameGraphicsItem::paintBackground( GeoPainter *painter )
+void FrameGraphicsItem::paintBackground( QPainter *painter )
{
painter->save();
@@ -231,22 +231,17 @@ void FrameGraphicsItem::paintBackground( GeoPainter *painter )
painter->restore();
}
-void FrameGraphicsItem::paint( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer )
+void FrameGraphicsItem::paint( QPainter *painter )
{
painter->save();
painter->translate( paintedRect().topLeft() );
paintBackground( painter );
painter->translate( d->m_padding, d->m_padding );
- paintContent( painter, viewport, renderPos, layer );
+ paintContent( painter );
painter->restore();
}
-void FrameGraphicsItem::paintContent( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer )
+void FrameGraphicsItem::paintContent( QPainter *painter )
{
Q_UNUSED( painter )
- Q_UNUSED( viewport )
- Q_UNUSED( renderPos )
- Q_UNUSED( layer )
}
diff --git a/src/lib/graphicsview/FrameGraphicsItem.h \
b/src/lib/graphicsview/FrameGraphicsItem.h index 891512b..8be07af 100644
--- a/src/lib/graphicsview/FrameGraphicsItem.h
+++ b/src/lib/graphicsview/FrameGraphicsItem.h
@@ -167,19 +167,17 @@ class MARBLE_EXPORT FrameGraphicsItem : public \
ScreenGraphicsItem /**
* This function won't be reimplemented in most cases.
*/
- virtual void paint( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer = 0 );
+ virtual void paint( QPainter *painter );
/**
* Here the items paint their content.
*/
- virtual void paintContent( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer = 0 \
); + virtual void paintContent( QPainter *painter );
/**
* Paints the background. This function won't be reimplemented in most cases.
*/
- virtual void paintBackground( GeoPainter *painter );
+ virtual void paintBackground( QPainter *painter );
private:
Q_DISABLE_COPY( FrameGraphicsItem )
diff --git a/src/lib/graphicsview/LabelGraphicsItem.cpp \
b/src/lib/graphicsview/LabelGraphicsItem.cpp index ca0943a..c819f72 100644
--- a/src/lib/graphicsview/LabelGraphicsItem.cpp
+++ b/src/lib/graphicsview/LabelGraphicsItem.cpp
@@ -12,14 +12,11 @@
#include "LabelGraphicsItem.h"
#include "LabelGraphicsItem_p.h"
-// Marble
-#include "GeoPainter.h"
-
// Qt
+#include <QtCore/QString>
#include <QtGui/QApplication>
-#include "MarbleDebug.h"
#include <QtGui/QFont>
-#include <QtCore/QString>
+#include <QtGui/QPainter>
using namespace Marble;
@@ -129,13 +126,8 @@ void LabelGraphicsItem::clear()
setContentSize( QSizeF( 0.0, 0.0 ) );
}
-void LabelGraphicsItem::paintContent( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer = 0 )
+void LabelGraphicsItem::paintContent( QPainter *painter )
{
- Q_UNUSED( viewport )
- Q_UNUSED( renderPos )
- Q_UNUSED( layer )
-
painter->save();
if ( !d->m_text.isNull() ) {
diff --git a/src/lib/graphicsview/LabelGraphicsItem.h \
b/src/lib/graphicsview/LabelGraphicsItem.h index 187cb26..ad99153 100644
--- a/src/lib/graphicsview/LabelGraphicsItem.h
+++ b/src/lib/graphicsview/LabelGraphicsItem.h
@@ -51,8 +51,7 @@ class MARBLE_EXPORT LabelGraphicsItem : public FrameGraphicsItem
void clear();
protected:
- void paintContent( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer );
+ void paintContent( QPainter *painter );
private:
Q_DISABLE_COPY( LabelGraphicsItem )
diff --git a/src/lib/graphicsview/MarbleGraphicsItem.cpp \
b/src/lib/graphicsview/MarbleGraphicsItem.cpp index f136b7e..27e15c4 100644
--- a/src/lib/graphicsview/MarbleGraphicsItem.cpp
+++ b/src/lib/graphicsview/MarbleGraphicsItem.cpp
@@ -13,13 +13,13 @@
#include "MarbleGraphicsItem_p.h"
// Marble
-#include "GeoPainter.h"
#include "MarbleDebug.h"
#include "ViewportParams.h"
// Qt
#include <QtCore/QList>
#include <QtCore/QSet>
+#include <QtGui/QPainter>
#include <QtGui/QPixmap>
#include <QtGui/QPixmapCache>
#include <QtGui/QMouseEvent>
@@ -36,8 +36,7 @@ MarbleGraphicsItem::~MarbleGraphicsItem()
delete d;
}
-bool MarbleGraphicsItem::paintEvent( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer *layer \
) +bool MarbleGraphicsItem::paintEvent( QPainter *painter, const ViewportParams \
*viewport ) {
if ( !p()->m_visibility ) {
return true;
@@ -82,16 +81,16 @@ bool MarbleGraphicsItem::paintEvent( GeoPainter *painter, \
ViewportParams *viewpo }
cachePixmap.fill( Qt::transparent );
- GeoPainter pixmapPainter( &( cachePixmap ), viewport, NormalQuality );
+ QPainter pixmapPainter( &cachePixmap );
// We paint in best quality here, as we only have to paint once.
pixmapPainter.setRenderHint( QPainter::Antialiasing, true );
// The cache image will get a 0.5 pixel bounding to save antialiasing \
effects. pixmapPainter.translate( 0.5, 0.5 );
- paint( &pixmapPainter, viewport, renderPos, layer );
+ paint( &pixmapPainter );
// Paint children
foreach ( MarbleGraphicsItem *item, p()->m_children ) {
- item->paintEvent( &pixmapPainter, viewport, renderPos, layer );
+ item->paintEvent( &pixmapPainter, viewport );
}
// Update the pixmap in cache
#if QT_VERSION < 0x040600
@@ -110,11 +109,11 @@ bool MarbleGraphicsItem::paintEvent( GeoPainter *painter, \
ViewportParams *viewpo painter->save();
painter->translate( position );
- paint( painter, viewport, renderPos, layer );
+ paint( painter );
// Paint children
foreach ( MarbleGraphicsItem *item, p()->m_children ) {
- item->paintEvent( painter, viewport, renderPos, layer );
+ item->paintEvent( painter, viewport );
}
painter->restore();
@@ -241,12 +240,8 @@ QRectF MarbleGraphicsItem::contentRect() const
return QRectF( QPointF( 0, 0 ), contentSize() );
}
-void MarbleGraphicsItem::paint( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer )
+void MarbleGraphicsItem::paint( QPainter *painter )
{
- Q_UNUSED( viewport );
- Q_UNUSED( renderPos );
- Q_UNUSED( layer );
Q_UNUSED( painter );
}
diff --git a/src/lib/graphicsview/MarbleGraphicsItem.h \
b/src/lib/graphicsview/MarbleGraphicsItem.h index 83ca8cd..49a6f90 100644
--- a/src/lib/graphicsview/MarbleGraphicsItem.h
+++ b/src/lib/graphicsview/MarbleGraphicsItem.h
@@ -21,13 +21,12 @@
class QEvent;
class QObject;
+class QPainter;
namespace Marble
{
class AbstractMarbleGraphicsLayout;
-class GeoPainter;
-class GeoSceneLayer;
class ViewportParams;
class MarbleGraphicsItemPrivate;
@@ -49,8 +48,7 @@ class MARBLE_EXPORT MarbleGraphicsItem
* Paints the item on the screen in view coordinates.
* It is not safe to call this function from a thread other than the gui thread.
*/
- bool paintEvent( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer *layer = 0 );
+ bool paintEvent( QPainter *painter, const ViewportParams *viewport );
/**
* Returns true if the Item contains @p point in parent coordinates.
@@ -133,8 +131,7 @@ class MARBLE_EXPORT MarbleGraphicsItem
* Paints the item in item coordinates. This has to be reimplemented by the \
subclass
* This function will be called by paintEvent().
*/
- virtual void paint( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer = 0 );
+ virtual void paint( QPainter *painter );
protected:
explicit MarbleGraphicsItem( MarbleGraphicsItemPrivate *d_ptr );
diff --git a/src/lib/graphicsview/MarbleGraphicsItem_p.h \
b/src/lib/graphicsview/MarbleGraphicsItem_p.h index a639b51..c0e2c25 100644
--- a/src/lib/graphicsview/MarbleGraphicsItem_p.h
+++ b/src/lib/graphicsview/MarbleGraphicsItem_p.h
@@ -13,7 +13,6 @@
// Marble
#include "AbstractMarbleGraphicsLayout.h"
-#include "GeoPainter.h"
#include "MarbleGraphicsItem.h"
// Qt
diff --git a/src/lib/graphicsview/WidgetGraphicsItem.cpp \
b/src/lib/graphicsview/WidgetGraphicsItem.cpp index 0ea6346..b2ed9fa 100644
--- a/src/lib/graphicsview/WidgetGraphicsItem.cpp
+++ b/src/lib/graphicsview/WidgetGraphicsItem.cpp
@@ -13,13 +13,13 @@
#include "WidgetGraphicsItem_p.h"
// Marble
-#include "GeoPainter.h"
#include "MarbleWidget.h"
#include "MarbleDebug.h"
// Qt
#include <QtGui/QApplication>
#include <QtGui/QMouseEvent>
+#include <QtGui/QPainter>
#include <QtGui/QWidget>
using namespace Marble;
@@ -59,13 +59,8 @@ QWidget *WidgetGraphicsItem::widget() const {
return d->m_widget;
}
-void WidgetGraphicsItem::paint( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer )
+void WidgetGraphicsItem::paint( QPainter *painter )
{
- Q_UNUSED( viewport );
- Q_UNUSED( layer );
- Q_UNUSED( renderPos );
-
if( d->m_widget == 0 )
return;
diff --git a/src/lib/graphicsview/WidgetGraphicsItem.h \
b/src/lib/graphicsview/WidgetGraphicsItem.h index d98b632..0657ebb 100644
--- a/src/lib/graphicsview/WidgetGraphicsItem.h
+++ b/src/lib/graphicsview/WidgetGraphicsItem.h
@@ -38,8 +38,7 @@ class MARBLE_EXPORT WidgetGraphicsItem : public ScreenGraphicsItem
/**
* Paints the item in item coordinates.
*/
- virtual void paint( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer = 0 );
+ virtual void paint( QPainter *painter );
protected:
virtual bool eventFilter( QObject *, QEvent * );
diff --git a/src/lib/graphicsview/WidgetGraphicsItem_p.h \
b/src/lib/graphicsview/WidgetGraphicsItem_p.h index 81eb026..06ebbc1 100644
--- a/src/lib/graphicsview/WidgetGraphicsItem_p.h
+++ b/src/lib/graphicsview/WidgetGraphicsItem_p.h
@@ -13,9 +13,7 @@
#include "WidgetGraphicsItem.h"
-#include <QtGui/QWidget>
-
-#include <QtCore/QDebug>
+class QWidget;
namespace Marble
{
diff --git a/src/plugins/render/compass/CompassFloatItem.cpp \
b/src/plugins/render/compass/CompassFloatItem.cpp index e5faca0..1c37101 100644
--- a/src/plugins/render/compass/CompassFloatItem.cpp
+++ b/src/plugins/render/compass/CompassFloatItem.cpp
@@ -14,11 +14,11 @@
#include "MarbleDebug.h"
#include "MarbleDirs.h"
-#include "GeoPainter.h"
#include "ViewportParams.h"
#include <QtCore/QRect>
#include <QtGui/QColor>
+#include <QtGui/QPainter>
#include <QtGui/QPixmap>
#include <QtGui/QPushButton>
#include <QtSvg/QSvgRenderer>
@@ -128,15 +128,8 @@ void CompassFloatItem::changeViewport( ViewportParams *viewport \
) }
}
-void CompassFloatItem::paintContent( GeoPainter *painter,
- ViewportParams *viewport,
- const QString& renderPos,
- GeoSceneLayer * layer )
+void CompassFloatItem::paintContent( QPainter *painter )
{
- Q_UNUSED( viewport )
- Q_UNUSED( layer )
- Q_UNUSED( renderPos )
-
painter->save();
QRectF compassRect( contentRect() );
diff --git a/src/plugins/render/compass/CompassFloatItem.h \
b/src/plugins/render/compass/CompassFloatItem.h index afdad8e..691b808 100644
--- a/src/plugins/render/compass/CompassFloatItem.h
+++ b/src/plugins/render/compass/CompassFloatItem.h
@@ -67,8 +67,7 @@ class CompassFloatItem : public AbstractFloatItem, public \
DialogConfigurationIn
void changeViewport( ViewportParams *viewport );
- void paintContent( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer = 0 );
+ void paintContent( QPainter *painter );
QDialog *configDialog();
diff --git a/src/plugins/render/earthquake/EarthquakeItem.cpp \
b/src/plugins/render/earthquake/EarthquakeItem.cpp index 305063d..108b0f6 100644
--- a/src/plugins/render/earthquake/EarthquakeItem.cpp
+++ b/src/plugins/render/earthquake/EarthquakeItem.cpp
@@ -9,10 +9,10 @@
//
#include "EarthquakeItem.h"
-#include "GeoPainter.h"
#include "ViewportParams.h"
#include <QtGui/QFontMetrics>
+#include <QtGui/QPainter>
#include <QtGui/QPixmap>
#include <QtSvg/QSvgRenderer>
@@ -65,13 +65,8 @@ void EarthquakeItem::setMagnitude( double magnitude )
updateTooltip();
}
-void EarthquakeItem::paint( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer )
+void EarthquakeItem::paint( QPainter *painter )
{
- Q_UNUSED( viewport )
- Q_UNUSED( renderPos )
- Q_UNUSED( layer )
-
// Save the old painter state.
painter->save();
diff --git a/src/plugins/render/earthquake/EarthquakeItem.h \
b/src/plugins/render/earthquake/EarthquakeItem.h index 3a23e7a..85c13f8 100644
--- a/src/plugins/render/earthquake/EarthquakeItem.h
+++ b/src/plugins/render/earthquake/EarthquakeItem.h
@@ -36,8 +36,7 @@ public:
bool initialized();
// Here the item gets painted
- void paint( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer = 0 );
+ void paint( QPainter *painter );
bool operator<( const AbstractDataPluginItem *other ) const;
diff --git a/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp \
b/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp index \
eb13aee..1c9127b 100644
--- a/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp
+++ b/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp
@@ -12,6 +12,7 @@
#include "ElevationProfileFloatItem.h"
#include <QtCore/QRect>
+#include <QtGui/QPainter>
#include <QtGui/QPushButton>
#include <QtGui/QMenu>
@@ -21,7 +22,6 @@
#include "MarbleWidget.h"
#include "GeoDataPlacemark.h"
#include "GeoDataTreeModel.h"
-#include "GeoPainter.h"
#include "ViewportParams.h"
#include "routing/RoutingModel.h"
#include "routing/RoutingManager.h"
@@ -179,15 +179,8 @@ void ElevationProfileFloatItem::changeViewport( ViewportParams \
*viewport ) update();
}
-void ElevationProfileFloatItem::paintContent( GeoPainter *painter,
- ViewportParams *viewport,
- const QString& renderPos,
- GeoSceneLayer * layer )
+void ElevationProfileFloatItem::paintContent( QPainter *painter )
{
- Q_UNUSED( viewport )
- Q_UNUSED( renderPos )
- Q_UNUSED( layer )
-
painter->save();
painter->setRenderHint( QPainter::Antialiasing, true );
painter->setFont( font() );
diff --git a/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.h \
b/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.h index \
788faaa..cb3bff1 100644
--- a/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.h
+++ b/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.h
@@ -80,8 +80,7 @@ class ElevationProfileFloatItem : public AbstractFloatItem, public \
DialogConfigu
virtual void changeViewport( ViewportParams *viewport );
- virtual void paintContent( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer = 0 );
+ virtual void paintContent( QPainter *painter );
QDialog *configDialog();
diff --git a/src/plugins/render/elevationprofilemarker/ElevationProfileMarker.cpp \
b/src/plugins/render/elevationprofilemarker/ElevationProfileMarker.cpp index \
870a602..4f10b8f 100644
--- a/src/plugins/render/elevationprofilemarker/ElevationProfileMarker.cpp
+++ b/src/plugins/render/elevationprofilemarker/ElevationProfileMarker.cpp
@@ -133,6 +133,9 @@ bool ElevationProfileMarker::isInitialized() const
bool ElevationProfileMarker::render( GeoPainter* painter, ViewportParams* viewport, \
const QString& renderPos, GeoSceneLayer* layer ) {
+ Q_UNUSED( renderPos )
+ Q_UNUSED( layer )
+
if ( !m_markerPlacemark )
return true;
@@ -177,7 +180,7 @@ bool ElevationProfileMarker::render( GeoPainter* painter, \
ViewportParams* viewpo
painter->save();
- m_markerItem.paintEvent( painter, viewport, renderPos, layer );
+ m_markerItem.paintEvent( painter, viewport );
painter->restore();
}
diff --git a/src/plugins/render/mapscale/MapScaleFloatItem.cpp \
b/src/plugins/render/mapscale/MapScaleFloatItem.cpp index 1c17ed0..b2d366f 100644
--- a/src/plugins/render/mapscale/MapScaleFloatItem.cpp
+++ b/src/plugins/render/mapscale/MapScaleFloatItem.cpp
@@ -13,6 +13,7 @@
#include <QtCore/QRect>
#include <QtGui/QPixmap>
#include <QtGui/QApplication>
+#include <QtGui/QPainter>
#include <QtGui/QPushButton>
#include <QtGui/QMenu>
#include <QtGui/QToolTip>
@@ -23,7 +24,6 @@
#include "Projections/AbstractProjection.h"
#include "MarbleLocale.h"
#include "MarbleModel.h"
-#include "GeoPainter.h"
#include "ViewportParams.h"
namespace Marble
@@ -165,15 +165,8 @@ void MapScaleFloatItem::changeViewport( ViewportParams *viewport \
) }
}
-void MapScaleFloatItem::paintContent( GeoPainter *painter,
- ViewportParams *viewport,
- const QString& renderPos,
- GeoSceneLayer * layer )
+void MapScaleFloatItem::paintContent( QPainter *painter )
{
- Q_UNUSED( viewport )
- Q_UNUSED( layer )
- Q_UNUSED( renderPos )
-
painter->save();
painter->setRenderHint( QPainter::Antialiasing, true );
diff --git a/src/plugins/render/mapscale/MapScaleFloatItem.h \
b/src/plugins/render/mapscale/MapScaleFloatItem.h index b68a46b..e3a2b8c 100644
--- a/src/plugins/render/mapscale/MapScaleFloatItem.h
+++ b/src/plugins/render/mapscale/MapScaleFloatItem.h
@@ -64,8 +64,7 @@ class MapScaleFloatItem : public AbstractFloatItem, public \
DialogConfigurationIn
void changeViewport( ViewportParams *viewport );
- void paintContent( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer = 0 );
+ void paintContent( QPainter *painter );
QDialog *configDialog();
diff --git a/src/plugins/render/opendesktop/OpenDesktopItem.cpp \
b/src/plugins/render/opendesktop/OpenDesktopItem.cpp index b7930ee..657f41f 100644
--- a/src/plugins/render/opendesktop/OpenDesktopItem.cpp
+++ b/src/plugins/render/opendesktop/OpenDesktopItem.cpp
@@ -9,9 +9,11 @@
//
#include "OpenDesktopItem.h"
-#include "GeoPainter.h"
+
+#include <QtGui/QPainter>
+
#include "ViewportParams.h"
-
+
using namespace Marble;
OpenDesktopItem::OpenDesktopItem(QObject *parent):
@@ -66,13 +68,8 @@ void OpenDesktopItem::addDownloadedFile( const QString& url, const \
QString& type }
}
-void OpenDesktopItem::paint( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer )
+void OpenDesktopItem::paint( QPainter *painter )
{
- Q_UNUSED( renderPos )
- Q_UNUSED( layer )
- Q_UNUSED( viewport )
-
painter->drawPixmap(0, 0, m_pixmap);
}
diff --git a/src/plugins/render/opendesktop/OpenDesktopItem.h \
b/src/plugins/render/opendesktop/OpenDesktopItem.h index 78078d9..bf901f7 100644
--- a/src/plugins/render/opendesktop/OpenDesktopItem.h
+++ b/src/plugins/render/opendesktop/OpenDesktopItem.h
@@ -37,7 +37,7 @@ class OpenDesktopItem : public AbstractDataPluginItem
void addDownloadedFile( const QString& url, const QString& type );
- void paint( GeoPainter *painter, ViewportParams *viewport, const QString& \
renderPos, GeoSceneLayer * layer ); + void paint( QPainter *painter );
bool operator<( const AbstractDataPluginItem *other ) const;
diff --git a/src/plugins/render/overviewmap/OverviewMap.cpp \
b/src/plugins/render/overviewmap/OverviewMap.cpp index bc9aea4..11b2c43 100644
--- a/src/plugins/render/overviewmap/OverviewMap.cpp
+++ b/src/plugins/render/overviewmap/OverviewMap.cpp
@@ -14,6 +14,7 @@
#include <QtCore/QStringList>
#include <QtGui/QCursor>
#include <QtGui/QMouseEvent>
+#include <QtGui/QPainter>
#include <QtGui/QPixmap>
#include <QtGui/QFileDialog>
#include <QtGui/QHBoxLayout>
@@ -25,7 +26,6 @@
#include "MarbleModel.h"
#include "ui_OverviewMapConfigWidget.h"
-#include "GeoPainter.h"
#include "GeoDataPoint.h"
#include "ViewportParams.h"
#include "MarbleWidget.h"
@@ -176,13 +176,8 @@ void OverviewMap::changeViewport( ViewportParams *viewport )
}
}
-void OverviewMap::paintContent( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer )
+void OverviewMap::paintContent( QPainter *painter )
{
- Q_UNUSED( viewport );
- Q_UNUSED( layer );
- Q_UNUSED( renderPos );
-
painter->save();
QRectF mapRect( contentRect() );
diff --git a/src/plugins/render/overviewmap/OverviewMap.h \
b/src/plugins/render/overviewmap/OverviewMap.h index 9db547d..724e2c6 100644
--- a/src/plugins/render/overviewmap/OverviewMap.h
+++ b/src/plugins/render/overviewmap/OverviewMap.h
@@ -73,8 +73,7 @@ class OverviewMap : public AbstractFloatItem, public \
DialogConfigurationInterfac
void changeViewport( ViewportParams *viewport );
- void paintContent( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer = 0 );
+ void paintContent( QPainter *painter );
/**
* @return: The settings of the item.
diff --git a/src/plugins/render/postalcode/PostalCodeItem.cpp \
b/src/plugins/render/postalcode/PostalCodeItem.cpp index 13702d7..22639e1 100644
--- a/src/plugins/render/postalcode/PostalCodeItem.cpp
+++ b/src/plugins/render/postalcode/PostalCodeItem.cpp
@@ -12,11 +12,11 @@
#include "PostalCodeItem.h"
// Marble
-#include "GeoPainter.h"
#include "ViewportParams.h"
// Qt
#include <QtGui/QFontMetrics>
+#include <QtGui/QPainter>
using namespace Marble;
@@ -61,13 +61,8 @@ void PostalCodeItem::setText( const QString& text )
m_text = text;
}
-void PostalCodeItem::paint( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer )
+void PostalCodeItem::paint( QPainter *painter )
{
- Q_UNUSED( renderPos )
- Q_UNUSED( layer )
- Q_UNUSED( viewport )
-
painter->save();
const int fontAscent = QFontMetrics( s_font ).ascent();
diff --git a/src/plugins/render/postalcode/PostalCodeItem.h \
b/src/plugins/render/postalcode/PostalCodeItem.h index 999f1d2..020703e 100644
--- a/src/plugins/render/postalcode/PostalCodeItem.h
+++ b/src/plugins/render/postalcode/PostalCodeItem.h
@@ -31,8 +31,7 @@ class PostalCodeItem : public AbstractDataPluginItem
bool initialized();
- void paint( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer = 0 );
+ void paint( QPainter *painter );
bool operator<( const AbstractDataPluginItem *other ) const;
diff --git a/src/plugins/render/progress/ProgressFloatItem.cpp \
b/src/plugins/render/progress/ProgressFloatItem.cpp index d847644..937f862 100644
--- a/src/plugins/render/progress/ProgressFloatItem.cpp
+++ b/src/plugins/render/progress/ProgressFloatItem.cpp
@@ -15,7 +15,6 @@
#include "MarbleDirs.h"
#include "MarbleModel.h"
#include "MarbleWidget.h"
-#include "GeoPainter.h"
#include "ViewportParams.h"
#include "HttpDownloadManager.h"
@@ -23,6 +22,7 @@
#include <QtGui/QColor>
#include <QtCore/QMutexLocker>
#include <QtGui/QPaintDevice>
+#include <QtGui/QPainter>
namespace Marble
{
@@ -159,13 +159,8 @@ QPainterPath ProgressFloatItem::backgroundShape() const
return path;
}
-void ProgressFloatItem::paintContent( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer \
) +void ProgressFloatItem::paintContent( QPainter *painter )
{
- Q_UNUSED( viewport )
- Q_UNUSED( layer )
- Q_UNUSED( renderPos )
-
// Stop repaint timer if it is already running
m_repaintTimer.stop();
diff --git a/src/plugins/render/progress/ProgressFloatItem.h \
b/src/plugins/render/progress/ProgressFloatItem.h index 326ae78..9e52f24 100644
--- a/src/plugins/render/progress/ProgressFloatItem.h
+++ b/src/plugins/render/progress/ProgressFloatItem.h
@@ -61,8 +61,7 @@ class ProgressFloatItem : public AbstractFloatItem
QPainterPath backgroundShape() const;
- void paintContent( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer = 0 );
+ void paintContent( QPainter *painter );
bool eventFilter(QObject *object, QEvent *e);
diff --git a/src/plugins/render/wikipedia/WikipediaItem.cpp \
b/src/plugins/render/wikipedia/WikipediaItem.cpp index 65bdac9..ca2edea 100644
--- a/src/plugins/render/wikipedia/WikipediaItem.cpp
+++ b/src/plugins/render/wikipedia/WikipediaItem.cpp
@@ -14,13 +14,13 @@
// Qt
#include <QtGui/QAction>
#include <QtGui/QIcon>
+#include <QtGui/QPainter>
#include <QtGui/QPixmap>
#include <QtGui/QMouseEvent>
#include <QtWebKit/QWebView>
// Marble
#include "MarbleDebug.h"
-#include "GeoPainter.h"
#include "ViewportParams.h"
#include "GeoSceneLayer.h"
#include "TinyWebBrowser.h"
@@ -86,13 +86,8 @@ bool WikipediaItem::operator<( const AbstractDataPluginItem *other \
) const return otherItem ? m_rank > otherItem->m_rank : id() < other->id();
}
-void WikipediaItem::paint( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer )
+void WikipediaItem::paint( QPainter *painter )
{
- Q_UNUSED( renderPos )
- Q_UNUSED( layer )
- Q_UNUSED( viewport )
-
if ( !showThumbnail() ) {
m_wikiIcon.paint( painter, wikiIconRect );
}
diff --git a/src/plugins/render/wikipedia/WikipediaItem.h \
b/src/plugins/render/wikipedia/WikipediaItem.h index 38f00a8..76b6896 100644
--- a/src/plugins/render/wikipedia/WikipediaItem.h
+++ b/src/plugins/render/wikipedia/WikipediaItem.h
@@ -44,8 +44,7 @@ class WikipediaItem : public AbstractDataPluginItem
void addDownloadedFile( const QString& url, const QString& type );
- void paint( GeoPainter *painter, ViewportParams *viewport,
- const QString& renderPos, GeoSceneLayer * layer = 0 );
+ void paint( QPainter *painter );
bool operator<( const AbstractDataPluginItem *other ) const;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic