Skip to content
Permalink
Browse files

* remove deprecated overloads QgsRasterLayer::lastError() and QgsRast…

…erLayer::lastErrorTitle()

* deprecate QgsRasterLayer::previewAsPixmap() (doesn't work in background threads)
* QImage::fill( QColor ) does not exists prior to Qt 4.8
diff --git a/src/core/raster/qgsrasterlayerrenderer.h b/src/core/raster/qgsrasterlayerrenderer.h
index 6ab4a49..40a27a2 100644
--- a/src/core/raster/qgsrasterlayerrenderer.h
+++ b/src/core/raster/qgsrasterlayerrenderer.h
@@ -8,7 +8,7 @@ class QPainter;
 class QgsMapToPixel;
 class QgsRasterLayer;
 class QgsRasterPipe;
-class QgsRasterViewPort;
+struct QgsRasterViewPort;
 class QgsRenderContext;

 class QgsRasterLayerRenderer : public QgsMapLayerRenderer
  • Loading branch information
jef-n committed Feb 24, 2014
1 parent b592335 commit 5db13abcf5c114d5292b198a153d70611abc1f5a
@@ -137,12 +137,6 @@ class QgsRasterLayer : QgsMapLayer
QgsRasterViewPort * myRasterViewPort,
const QgsMapToPixel* theQgsMapToPixel = 0 );

//! @deprecated since 2.4 - returns empty string
QString lastError() /Deprecated/;

//! @deprecated since 2.4 - returns empty string
QString lastErrorTitle() /Deprecated/;

/**Returns a list with classification items (Text and color)
@note this method was added in version 1.8*/
QList< QPair< QString, QColor > > legendSymbologyItems() const;
@@ -190,7 +184,7 @@ class QgsRasterLayer : QgsMapLayer

/** \brief Draws a preview of the rasterlayer into a pixmap
@note - use previewAsImage() for rendering with QGIS>=2.4 */
QPixmap previewAsPixmap( QSize size, QColor bgColor = QColor( 255, 255, 255 ) );
QPixmap previewAsPixmap( QSize size, QColor bgColor = QColor( 255, 255, 255 ) ) /Deprecated/;

/** \brief Draws a preview of the rasterlayer into a QImage
@note added in 2.4 */
@@ -304,16 +304,6 @@ void QgsRasterLayer::draw( QPainter * theQPainter,
QgsDebugMsg( QString( "total raster draw time (ms): %1" ).arg( time.elapsed(), 5 ) );
} //end of draw method

QString QgsRasterLayer::lastError()
{
return QString();
}

QString QgsRasterLayer::lastErrorTitle()
{
return QString();
}

QList< QPair< QString, QColor > > QgsRasterLayer::legendSymbologyItems() const
{
QList< QPair< QString, QColor > > symbolList;
@@ -1150,7 +1140,8 @@ QImage QgsRasterLayer::previewAsImage( QSize size, QColor bgColor, QImage::Forma
{
QImage myQImage( size, format );

myQImage.fill( bgColor ); //defaults to white, set to transparent for rendering on a map
myQImage.setColor( 0, bgColor.rgba() );
myQImage.fill( 0 ); //defaults to white, set to transparent for rendering on a map

QgsRasterViewPort *myRasterViewPort = new QgsRasterViewPort();

@@ -295,12 +295,6 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
QgsRasterViewPort * myRasterViewPort,
const QgsMapToPixel* theQgsMapToPixel = 0 );

//! @deprecated since 2.4 - returns empty string
Q_DECL_DEPRECATED QString lastError();

//! @deprecated since 2.4 - returns empty string
Q_DECL_DEPRECATED QString lastErrorTitle();

/**Returns a list with classification items (Text and color)
@note this method was added in version 1.8*/
QList< QPair< QString, QColor > > legendSymbologyItems() const;
@@ -348,7 +342,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer

/** \brief Draws a preview of the rasterlayer into a pixmap
@note - use previewAsImage() for rendering with QGIS>=2.4 */
QPixmap previewAsPixmap( QSize size, QColor bgColor = Qt::white );
Q_DECL_DEPRECATED QPixmap previewAsPixmap( QSize size, QColor bgColor = Qt::white );

/** \brief Draws a preview of the rasterlayer into a QImage
@note added in 2.4 */
@@ -8,7 +8,7 @@ class QPainter;
class QgsMapToPixel;
class QgsRasterLayer;
class QgsRasterPipe;
class QgsRasterViewPort;
struct QgsRasterViewPort;
class QgsRenderContext;

class QgsRasterLayerRenderer : public QgsMapLayerRenderer

0 comments on commit 5db13ab

Please sign in to comment.
You can’t perform that action at this time.