mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
allow popups from html wms responses
This commit is contained in:
parent
97d006cda1
commit
5af75da3e8
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user