4

I have Anaconda installed on my computer. When I open Spyder though, it looks terrible because the DPI is high. I've been told to run QT_SCALE_FACTOR=2.5 spyder to solve the problem. However, I get back 'QT_SCALE_FACTOR' is not recognized as an internal or external command, operable program or batch file. This is frustrating because I have pyqt installed through Anaconda. It's also part of my path C:\...\Anaconda3\Lib\site-packages\PyQt5 If I call qmake -query, I get:

qmake -query
QT_SYSROOT:
QT_INSTALL_PREFIX:C:/Users/.../Anaconda3/Library
QT_INSTALL_ARCHDATA:C:/Users/.../Anaconda3/Library
QT_INSTALL_DATA:C:/Users/.../Anaconda3/Library
QT_INSTALL_DOCS:C:/Users/.../Anaconda3/Library/doc
QT_INSTALL_HEADERS:C:/Users/.../Anaconda3/Library/include/qt
QT_INSTALL_LIBS:C:/Users/.../Anaconda3/Library/lib
QT_INSTALL_LIBEXECS:C:/Users/.../Anaconda3/Library/bin
QT_INSTALL_BINS:C:/Users/.../Anaconda3/Library/bin
QT_INSTALL_TESTS:C:/Users/.../Anaconda3/Library/tests
QT_INSTALL_PLUGINS:C:/Users/.../Anaconda3/Library/plugins
QT_INSTALL_IMPORTS:C:/Users/.../Anaconda3/Library/imports
QT_INSTALL_QML:C:/Users/.../Anaconda3/Library/qml
QT_INSTALL_TRANSLATIONS:C:/Users/.../Anaconda3/Library/translations
QT_INSTALL_CONFIGURATION:
QT_INSTALL_EXAMPLES:C:/Users/.../Anaconda3/Library/examples
QT_INSTALL_DEMOS:C:/Users/.../Anaconda3/Library/examples
QT_HOST_PREFIX:C:/Users/.../Anaconda3/Library
QT_HOST_DATA:C:/Users/.../Anaconda3/Library
QT_HOST_BINS:C:/Users/.../Anaconda3/Library/bin
QT_HOST_LIBS:C:/Users/.../Anaconda3/Library/lib
QMAKE_SPEC:win32-msvc2015
QMAKE_XSPEC:win32-msvc2015
QMAKE_VERSION:3.0
QT_VERSION:5.6.2

So as you can see, it appears I have it installed just fine. How come I can't call QT_SCALE_FACTOR? How can I do that correctly? Thanks! (Incidentally, I'm running Windows 10 if that helps.)

Elliptica
  • 3,928
  • 3
  • 37
  • 68

4 Answers4

7

Run next commands in windows console (cmd.exe):

set QT_SCALE_FACTOR=2.5
spyder
ramzes2
  • 773
  • 5
  • 13
6

Or in main.cpp

qputenv("QT_SCALE_FACTOR", "1.5");

But you schould also set before

QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps
xai
  • 61
  • 1
  • 2
0

Try changing your Spyder DPI settings in Windows:

  1. Right click on Spyder executable
  2. Properties->Compatability->Change high DPI settings->Tick the two boxes and choose "[when] I open this program" and "System (Enhanced)"
  3. Click Apply

This worked for me

Scott
  • 31
  • 3
0

I think I have found a decent solution. On my desktop I created the file anacondaNavigator.bat (just a .txt file renamed to .bat) with the following content

set root=C:\s\Anaconda3-2022.10

call %root%\Scripts\activate.bat %root%

anaconda-navigator

Where C:\s\Anaconda3-2022.10 is the custom Windows folder I used to install Anaconda. Note that the root path above should match the one for your Anaconda installation. Next, I edited the file

C:\s\Anaconda3-2022.10\Scripts\activate.bat

to add the following line at the end

set QT_SCALE_FACTOR=0.8

After saving the activate.bat file and executing anacondaNavigator.bat from my desktop, the look and feel of my navigator looked better.

I hope this also works for you.