Skip to content
Permalink
Browse files

Do not paint WMS preview images. Because it crashes.

Fix #16803
  • Loading branch information
m-kuhn committed Oct 4, 2017
1 parent 6f9798b commit fde624099552816f1c5133edc7b3576adf8d2257
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/providers/wms/qgswmsprovider.cpp
@@ -615,11 +615,16 @@ static void _drawDebugRect( QPainter& p, const QRectF& rect, const QColor& color

QImage *QgsWmsProvider::draw( QgsRectangle const & viewExtent, int pixelWidth, int pixelHeight, QgsRasterBlockFeedback* feedback )
{
QgsDebugMsg( "Entering." );
QImage* image = new QImage( pixelWidth, pixelHeight, QImage::Format_ARGB32 );

if ( QgsApplication::instance()->thread() == QThread::currentThread() )
{
QgsDebugMsg( "Trying to draw a WMS image on the main thread. Stop it!" );
return image;
}

// compose the URL query string for the WMS server.

QImage* image = new QImage( pixelWidth, pixelHeight, QImage::Format_ARGB32 );
image->fill( 0 );

if ( !mSettings.mTiled && mSettings.mMaxWidth == 0 && mSettings.mMaxHeight == 0 )

0 comments on commit fde6240

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