21 #include "qgis_core.h" 32 #include <QNetworkAccessManager> 34 #include <QTextBrowser> 55 PrivateBrowsingEnabled,
56 JavascriptCanOpenWindows,
57 JavascriptCanAccessClipboard,
58 DeveloperExtrasEnabled,
59 LinksIncludedInFocusChain,
61 PrintElementBackgrounds,
62 OfflineStorageDatabaseEnabled,
63 OfflineWebApplicationCacheEnabled,
65 LocalContentCanAccessRemoteUrls,
68 AcceleratedCompositingEnabled,
69 SpatialNavigationEnabled,
70 LocalContentCanAccessFileUrls,
71 TiledBackingStoreEnabled,
72 FrameFlatteningEnabled,
73 SiteSpecificQuirksEnabled,
74 JavascriptCanCloseWindows,
77 HyperlinkAuditingEnabled,
79 ScrollAnimatorEnabled,
88 void setUserStyleSheetUrl(
const QUrl & )
92 void setAttribute( WebAttribute,
bool )
110 enum LinkDelegationPolicy
113 DelegateExternalLinks,
123 explicit QWebPage( QObject *parent =
nullptr )
136 QPalette palette()
const 141 void setPalette(
const QPalette &palette )
146 void setViewportSize(
const QSize &size )
const 151 void setLinkDelegationPolicy( LinkDelegationPolicy linkDelegationPolicy )
156 QTextBrowser *tb = qobject_cast<QTextBrowser *>( parent() );
160 tb->setOpenExternalLinks( linkDelegationPolicy != DontDelegateLinks );
163 void setNetworkAccessManager( QNetworkAccessManager *networkAccessManager )
165 Q_UNUSED( networkAccessManager )
178 QSize viewportSize()
const 183 QMenu *createStandardContextMenu()
190 void loadFinished(
bool ok );
192 void downloadRequested(
const QNetworkRequest &request );
194 void unsupportedContent( QNetworkReply *reply );
200 virtual void javaScriptConsoleMessage(
const QString &,
int,
const QString & ) {}
237 void setIdentifier(
const QString &identifier ) { mIdentifier = identifier; }
250 if ( mIdentifier.isEmpty() )
253 QgsMessageLog::logMessage( tr(
"%1 (line %2): %3" ).arg( mIdentifier ).arg( lineNumber ).arg( message ), tr(
"JavaScript" ) );
262 #endif // QGSWEBPAGE_H QString identifier() const
Returns the QgsWebPage's identifier.
void setIdentifier(const QString &identifier)
Sets an identifier for the QgsWebPage.
The QWebSettings class is a collection of stubs to mimic the API of a QWebSettings on systems where Q...
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
void javaScriptConsoleMessage(const QString &message, int lineNumber, const QString &) override
QgsWebPage(QObject *parent=nullptr)
Constructor for QgsWebPage.
The QWebPage class is a collection of stubs to mimic the API of a QWebPage on systems where QtWebkit ...
QWebPage subclass which redirects JavaScript errors and console output to the QGIS message log...
The QWebFrame class is a collection of stubs to mimic the API of a QWebFrame on systems where QtWebki...