Skip to content

Commit

Permalink
Merge pull request #2426 from elpaso/bugfix-13747-bis
Browse files Browse the repository at this point in the history
Added HiDPI support to QgsWebView
  • Loading branch information
elpaso committed Nov 7, 2015
2 parents f77d6cd + dbd9b9b commit 061bdde
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/core/qgswebview.h
Expand Up @@ -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
{
Expand All @@ -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"
Expand Down
6 changes: 5 additions & 1 deletion src/gui/editorwidgets/qgsphotowidgetwrapper.h
Expand Up @@ -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.
Expand Down

0 comments on commit 061bdde

Please sign in to comment.