Skip to content

Commit

Permalink
Enable HighDPI scaling
Browse files Browse the repository at this point in the history
This should scale up things automatically, without needing to set e.g.
default-zoom (at least with QtWebEngine).

See #1993, #1585
  • Loading branch information
The-Compiler committed Dec 8, 2016
1 parent c7d4ea5 commit 62bcd24
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion qutebrowser/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtGui import QDesktopServices, QPixmap, QIcon, QWindow
from PyQt5.QtCore import (pyqtSlot, qInstallMessageHandler, QTimer, QUrl,
QObject, QEvent, pyqtSignal)
QObject, QEvent, Qt, pyqtSignal)
try:
import hunter
except ImportError:
Expand Down Expand Up @@ -70,6 +70,14 @@ def run(args):
quitter = Quitter(args)
objreg.register('quitter', quitter)

# Enable HighDPI
assert QApplication.instance() is None
try:
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True)
except AttributeError:
# Qt < 5.6
pass

global qApp
qApp = Application(args)
qApp.setOrganizationName("qutebrowser")
Expand Down

0 comments on commit 62bcd24

Please sign in to comment.