Skip to content
Permalink
Browse files

allow popups from html wms responses

  • Loading branch information
jef-n committed May 6, 2013
1 parent 97d006c commit 5af75da3e89abd8b818d3986c26b23c49f4b8147
Showing with 24 additions and 0 deletions.
  1. +23 −0 src/app/qgsidentifyresultsdialog.cpp
  2. +1 −0 src/app/qgsidentifyresultsdialog.h
@@ -57,6 +57,7 @@ QgsIdentifyResultsWebView::QgsIdentifyResultsWebView( QWidget *parent ) : QWebVi
// page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
page()->setLinkDelegationPolicy( QWebPage::DontDelegateLinks );
settings()->setAttribute( QWebSettings::LocalContentCanAccessRemoteUrls, true );
settings()->setAttribute( QWebSettings::JavascriptCanOpenWindows, true );
#ifdef QGISDEBUG
settings()->setAttribute( QWebSettings::DeveloperExtrasEnabled, true );
#endif
@@ -85,6 +86,28 @@ void QgsIdentifyResultsWebView::contextMenuEvent( QContextMenuEvent *e )
delete menu;
}

QWebView *QgsIdentifyResultsWebView::createWindow( QWebPage::WebWindowType type )
{
QDialog *d = new QDialog( this );
QLayout *l = new QVBoxLayout( d );

QWebView *wv = new QWebView( d );
l->addWidget( wv );

wv->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Minimum );
wv->page()->setNetworkAccessManager( QgsNetworkAccessManager::instance() );
wv->settings()->setAttribute( QWebSettings::LocalContentCanAccessRemoteUrls, true );
wv->settings()->setAttribute( QWebSettings::JavascriptCanOpenWindows, true );
#ifdef QGISDEBUG
wv->settings()->setAttribute( QWebSettings::DeveloperExtrasEnabled, true );
#endif

d->setModal( type != QWebPage::WebBrowserWindow );
d->show();

return wv;
}

// QgsIdentifyResultsWebView size:
// ---------------
//
@@ -56,6 +56,7 @@ class QgsIdentifyResultsWebView : public QWebView
void print( void );
protected:
void contextMenuEvent( QContextMenuEvent* );
QWebView *createWindow( QWebPage::WebWindowType type );
};

class QgsIdentifyResultsFeatureItem: public QTreeWidgetItem

0 comments on commit 5af75da

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