Skip to content

Commit 5db13ab

Browse files
committed
* remove deprecated overloads QgsRasterLayer::lastError() and QgsRasterLayer::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
1 parent b592335 commit 5db13ab

File tree

4 files changed

+5
-26
lines changed

4 files changed

+5
-26
lines changed

python/core/raster/qgsrasterlayer.sip

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,6 @@ class QgsRasterLayer : QgsMapLayer
137137
QgsRasterViewPort * myRasterViewPort,
138138
const QgsMapToPixel* theQgsMapToPixel = 0 );
139139

140-
//! @deprecated since 2.4 - returns empty string
141-
QString lastError() /Deprecated/;
142-
143-
//! @deprecated since 2.4 - returns empty string
144-
QString lastErrorTitle() /Deprecated/;
145-
146140
/**Returns a list with classification items (Text and color)
147141
@note this method was added in version 1.8*/
148142
QList< QPair< QString, QColor > > legendSymbologyItems() const;
@@ -190,7 +184,7 @@ class QgsRasterLayer : QgsMapLayer
190184

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

195189
/** \brief Draws a preview of the rasterlayer into a QImage
196190
@note added in 2.4 */

src/core/raster/qgsrasterlayer.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -304,16 +304,6 @@ void QgsRasterLayer::draw( QPainter * theQPainter,
304304
QgsDebugMsg( QString( "total raster draw time (ms): %1" ).arg( time.elapsed(), 5 ) );
305305
} //end of draw method
306306

307-
QString QgsRasterLayer::lastError()
308-
{
309-
return QString();
310-
}
311-
312-
QString QgsRasterLayer::lastErrorTitle()
313-
{
314-
return QString();
315-
}
316-
317307
QList< QPair< QString, QColor > > QgsRasterLayer::legendSymbologyItems() const
318308
{
319309
QList< QPair< QString, QColor > > symbolList;
@@ -1150,7 +1140,8 @@ QImage QgsRasterLayer::previewAsImage( QSize size, QColor bgColor, QImage::Forma
11501140
{
11511141
QImage myQImage( size, format );
11521142

1153-
myQImage.fill( bgColor ); //defaults to white, set to transparent for rendering on a map
1143+
myQImage.setColor( 0, bgColor.rgba() );
1144+
myQImage.fill( 0 ); //defaults to white, set to transparent for rendering on a map
11541145

11551146
QgsRasterViewPort *myRasterViewPort = new QgsRasterViewPort();
11561147

src/core/raster/qgsrasterlayer.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,6 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
295295
QgsRasterViewPort * myRasterViewPort,
296296
const QgsMapToPixel* theQgsMapToPixel = 0 );
297297

298-
//! @deprecated since 2.4 - returns empty string
299-
Q_DECL_DEPRECATED QString lastError();
300-
301-
//! @deprecated since 2.4 - returns empty string
302-
Q_DECL_DEPRECATED QString lastErrorTitle();
303-
304298
/**Returns a list with classification items (Text and color)
305299
@note this method was added in version 1.8*/
306300
QList< QPair< QString, QColor > > legendSymbologyItems() const;
@@ -348,7 +342,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
348342

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

353347
/** \brief Draws a preview of the rasterlayer into a QImage
354348
@note added in 2.4 */

src/core/raster/qgsrasterlayerrenderer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class QPainter;
88
class QgsMapToPixel;
99
class QgsRasterLayer;
1010
class QgsRasterPipe;
11-
class QgsRasterViewPort;
11+
struct QgsRasterViewPort;
1212
class QgsRenderContext;
1313

1414
class QgsRasterLayerRenderer : public QgsMapLayerRenderer

0 commit comments

Comments
 (0)