SeriousAlexej / TabToolbar

A small library for creating tabbed toolbars
Other
284 stars 108 forks source link

Support for High-DPI screens #5

Closed asdfjkl closed 4 years ago

asdfjkl commented 4 years ago

Currently there are issues when high-dpi screens with scaling are used. Consider the attachments for illustration. One is Ubuntu 18.04@1920*1080. The other one is when double scaling was activated in Ubuntu (Settings -> Screen -> Scale -> 200%), 100_percent Text under icons is cut off. Also, the size of the icons in the icon group in relation to the larger icons seems to be off. 200_percent

IngvarRiga commented 4 years ago

Win 10 under 4K Resolution: image

In qt 5.14, in main module :

...................
    //-- Включение масштабирования для экранов с высоким разрешением ?
    **QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);**

    QApplication a(argc, argv);
    MainWindow w;
............

And in Linux mint 19.XX on Virtual Machines (4K), also all normal, even when zooming in interface

asdfjkl commented 4 years ago

This could be related to https://forum.qt.io/topic/99255/how-to-check-screen-dpi-before-a-qapplication-exists/11 quote "AA_EnableHighDpiScaling needs to be set before a QApplication is started, but on Linux setting this property for a normal non-DPI display will cause everything to be 2x the size on Qt versions under 5.12."

The presented workaround there didn't work for me.

I assume that mint 19.xx ships with Qt >= 5.12; and the Windows 4k resolution was at higher dpi?

IngvarRiga commented 4 years ago

i`m use self-build static lib qt 5.14 on linux mint. And Linux on VM Ware on 27" 4K mon. So... cant check another... Oh, VMWare on Win 10.