Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Call QT_SCALE_FACTOR?

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.)

like image 895
Elliptica Avatar asked Dec 14 '22 23:12

Elliptica


2 Answers

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

set QT_SCALE_FACTOR=2.5
spyder
like image 111
ramzes2 Avatar answered Dec 26 '22 14:12

ramzes2


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
like image 37
xai Avatar answered Dec 26 '22 14:12

xai