Skip to content
Permalink
Browse files

implement #6128

  • Loading branch information
jef-n committed Aug 1, 2012
1 parent 0968589 commit 539b7cb7220152735449bf2cec2c1f77dce9d58d
Showing with 14 additions and 0 deletions.
  1. +12 −0 src/app/qgsidentifyresults.cpp
  2. +2 −0 src/app/qgsidentifyresults.h
@@ -41,6 +41,8 @@
#include <QMenuBar>
#include <QPushButton>
#include <QWebView>
#include <QDesktopServices>
#include <QMessageBox>

#include "qgslogger.h"

@@ -277,6 +279,8 @@ void QgsIdentifyResults::addFeature( QgsRasterLayer *layer,

QWebView *wv = new QWebView( attrItem->treeWidget() );
wv->setHtml( attributes.begin().value() );
wv->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
connect( wv, SIGNAL( linkClicked( const QUrl & ) ), this, SLOT( openUrl( const QUrl & ) ) );
attrItem->treeWidget()->setItemWidget( attrItem, 1, wv );
}
else
@@ -980,3 +984,11 @@ void QgsIdentifyResults::copyFeatureAttributes()
QgsDebugMsg( QString( "set clipboard: %1" ).arg( text ) );
clipboard->setText( text );
}

void QgsIdentifyResults::openUrl( const QUrl &url )
{
if ( !QDesktopServices::openUrl( url ) )
{
QMessageBox::warning( this, tr( "Could not open url" ), tr( "Could not open URL '%1'" ).arg( url.toString() ) );
}
}
@@ -112,6 +112,8 @@ class QgsIdentifyResults: public QDialog, private Ui::QgsIdentifyResultsBase

void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }

void openUrl( const QUrl &url );

private:
QMenu *mActionPopup;
QMap<QTreeWidgetItem *, QgsHighlight * > mHighlights;

0 comments on commit 539b7cb

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