Skip to content

Commit

Permalink
Fix webview DPIs
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso authored and nyalldawson committed Dec 7, 2021
1 parent 0adeeab commit 91f174a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/qgsaction.cpp
Expand Up @@ -24,6 +24,7 @@
#include <QTemporaryDir>
#include <QDialog>
#include <QLayout>
#include <QScreen>
#include <QNetworkRequest>
#include <QJsonDocument>
#include <QCryptographicHash>
Expand All @@ -36,7 +37,7 @@
#include "qgsexpressioncontextutils.h"
#include "qgswebview.h"
#include "qgsnetworkaccessmanager.h"

#include "qgsapplication.h"


bool QgsAction::runable() const
Expand Down Expand Up @@ -102,6 +103,8 @@ void QgsAction::run( const QgsExpressionContext &expressionContext ) const
d.setWindowTitle( QObject::tr( "Form Submit Action" ) );
d.setLayout( new QHBoxLayout( &d ) );
QgsWebView *wv = new QgsWebView( &d );
const double horizontalDpi { QgsApplication::primaryScreen()->logicalDotsPerInchX() };
wv->setZoomFactor( horizontalDpi / 96.0 );
wv->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
#ifdef QGISDEBUG
wv->page()->settings()->setAttribute( QWebSettings::DeveloperExtrasEnabled, true );
Expand Down

0 comments on commit 91f174a

Please sign in to comment.