@@ -383,38 +383,6 @@ void QgisApp::emitCustomSrsValidation( QgsCoordinateReferenceSystem &srs )
383
383
384
384
void QgisApp::layerTreeViewDoubleClicked ( const QModelIndex& index )
385
385
{
386
- // temporary solution for WMS legend
387
- if ( mLayerTreeView ->layerTreeModel ()->index2legendNode ( index ) )
388
- {
389
- QModelIndex parent = mLayerTreeView ->layerTreeModel ()->parent ( index );
390
- QgsLayerTreeNode* node = mLayerTreeView ->layerTreeModel ()->index2node ( parent );
391
- if ( QgsLayerTree::isLayer ( node ) )
392
- {
393
- QgsMapLayer* layer = QgsLayerTree::toLayer ( node )->layer ();
394
- QgsRasterLayer* rlayer = qobject_cast<QgsRasterLayer*>( layer );
395
- if ( rlayer && rlayer->providerType () == " wms" )
396
- {
397
- const QgsMapCanvas* canvas = mapCanvas ();
398
- QgsRectangle visibleExtent = canvas->mapSettings ().outputExtentToLayerExtent ( rlayer, canvas->extent () ); // in layer projection
399
- QImage img = rlayer->dataProvider ()->getLegendGraphic ( mMapCanvas ->scale (), false , &visibleExtent );
400
-
401
- QFrame* popup = new QFrame ();
402
- popup->setAttribute ( Qt::WA_DeleteOnClose );
403
- popup->setFrameStyle ( QFrame::Box | QFrame::Raised );
404
- popup->setLineWidth ( 2 );
405
- popup->setAutoFillBackground ( true );
406
- QVBoxLayout *layout = new QVBoxLayout;
407
- QLabel *label = new QLabel ( popup );
408
- label->setPixmap ( QPixmap::fromImage ( img ) );
409
- layout->addWidget ( label );
410
- popup->setLayout ( layout );
411
- popup->move ( mLayerTreeView ->visualRect ( index ).bottomLeft () );
412
- popup->show ();
413
- return ;
414
- }
415
- }
416
- }
417
-
418
386
QSettings settings;
419
387
switch ( settings.value ( " /qgis/legendDoubleClickAction" , 0 ).toInt () )
420
388
{
0 commit comments