Repository: spyder-ide/spyder

Issue:
Spyder doesn't render well on HighDpi screens
_From [mjdep...@gmail.com](https://code.google.com/u/112397940646561315916/) on 2015-01-15T10:51:45Z_

Please note that reporting bugs from Spyder's help menu ("?" > "Report
issue...") will fill version details for Spyder, Python and Qt in this description for you. 

What steps will reproduce the problem?
1. Using a 4K screen with 3840 x 2160 2. 3. 

What is the expected output? What do you see instead?

 expect size of windows and consoles to look normal. The biggest issue is in the variable explorer the headers are cut off height-wise. The preference window comes up really small. What version of the product are you using? On what operating system? spyder 2.3.2 py3.4 windows 8.1 

Please provide any additional information below

. I am stuck in a class and super bored right now. In reality these issues are incredibly minor. But would be cool if they were fixed. Thanks!

**Attachment:** [spyder screen shot.PNG](http://code.google.com/p/spyderlib/issues/detail?id=2119)

_Original issue: http://code.google.com/p/spyderlib/issues/detail?id=2119_



Discussion:
_From [ccordoba12](https://code.google.com/u/ccordoba12/) on 2015-02-08T11:00:23Z_

I don't have access to such a high screen resolution, sorry :-(

**Summary:** 4K screen resolution issues  <span class="oldvalue"> (was: 4K screen resolution issue) </span>  
  **Labels:** Cat-SpyderGUI MS-v2.4  

Fingers crossed this sort of thing will get better in Qt 5.6, but in the meantime with Qt 5.4+ it looks much better if you add the following to any qt.conf files in your python directory:

[Platforms]
WindowsArguments = dpiawareness=0

What does that do?

It tells windows that the application is not DPI aware, which makes windows render it at 'normal' resolution then scale the output image. This makes it look less sharp, but everything is the right size.
By default Qt reports that it is DPI aware, and tries to scale the UI, but still renders anything sized in terms of pixels 1:1, which tends to mean that some ui components are miniscule and others are stretched out of shape.
This is supposedly fixed properly in 5.6 https://doc-snapshots.qt.io/qt5-5.6/highdpi.html

@patstew if you run from master (and use the Spyder 3 icon theme), you will get the hight-dpi bitmaps for the icons.

@patstew So is it better with Qt5.6 ? 

No, and setting dpiawareness seems to have stopped working too.


Resolving patch:
diff --git a/spyderlib/app/spyder.py b/spyderlib/app/spyder.py
--- a/spyderlib/app/spyder.py
+++ b/spyderlib/app/spyder.py
@@ -90,6 +90,12 @@
 # Avoid a bug in Qt: https://bugreports.qt.io/browse/QTBUG-46720
 from qtpy import QtWebEngineWidgets  # analysis:ignore
 
+#==============================================================================
+# Proper high DPI scaling is available in Qt >= 5.6.0. This attibute must
+# be set before creating the application
+#==============================================================================
+if hasattr(Qt, 'AA_EnableHighDpiScaling'):
+    QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True)
 
 #==============================================================================
 # Create our QApplication instance here because it's needed to render the


Test patch: