Skip to content
Permalink
Browse files

Merge pull request #2426 from elpaso/bugfix-13747-bis

Added HiDPI support to QgsWebView
  • Loading branch information
elpaso committed Nov 7, 2015
2 parents f77d6cd + dbd9b9b commit 061bdde28f3e5f7419bb7f360fb3073d30c47d41
Showing with 15 additions and 2 deletions.
  1. +10 −1 src/core/qgswebview.h
  2. +5 −1 src/gui/editorwidgets/qgsphotowidgetwrapper.h
@@ -16,11 +16,13 @@
#ifndef QGSWEBVIEW_H
#define QGSWEBVIEW_H


#include <QWidget>
#include <QPrinter>

#ifdef WITH_QTWEBKIT
#include <QWebView>
#include <QDesktopWidget>

class CORE_EXPORT QgsWebView : public QWebView
{
@@ -29,7 +31,14 @@ class CORE_EXPORT QgsWebView : public QWebView
public:
explicit QgsWebView( QWidget* parent = 0 )
: QWebView( parent )
{}
{
QDesktopWidget desktop;
// Apply zoom factor for HiDPI screens
if ( desktop.physicalDpiX( ) > 96 )
{
setZoomFactor( desktop.physicalDpiX( ) / 96 );
}
}
};
#else
#include "qgswebpage.h"
@@ -22,7 +22,11 @@
#include <QLabel>
#include <QPushButton>
#include <QLineEdit>
#include "qgswebview.h"

#ifdef WITH_QTWEBKIT
#include <QWebView>
#endif


/**
* Wraps a photo widget. Will show a picture and a file chooser to change the picture.

0 comments on commit 061bdde

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