4 ms·
In my experience QML is buttery smooth on Linux, even on older hardware, but it just isn't as smooth on Windows.
by CarVac 5y ago
In my experience QML is buttery smooth on Linux, even on older hardware, but it just isn't as smooth on Windows.
- ChuckNorris89 5y agoYep, that's why KDE is so smooth even on older hardware. But on Windows, some QT apps (GnuPG pinentry-qt for example) often have weird scaling issues where they de-snap and move out of their place.
- joezydeco 5y agoQt still hasn't figured out to work with Windows desktop scaling. It's a nightmare on high-DPI displays. I wrestled with this 5 years ago and it's still not fixed.
- deleted 5y ago[deleted]
- CarVac 5y agoWith QML you can implement native fractional scaling but I don't know how it interacts with Windows's scaling mostly because I don't have a high DPI screen on my Windows computer. My application has a setting where you can choose whatever arbitrary scale you want, smaller or larger than default.
- joezydeco 5y agoHere's a fun test when you get a High-DPI screen for testing: hook two screens to Windows, one high and one low-DPI. Then drag the Qt app from one window to the other. Virtualbox's windows GUI is Qt and shows the problem pretty easily.
- nyanpasu64 5y agoIt's a lot more complicated than that. I'm speaking from experience with Qt 5.14-15 and Qt 6. Qt 5 defaults to "DPI scaling off", where text is enlarged but 1px is always 1px regardless of the current scale (so UI elements sized in px can end up too small on HiDPI displays). It has a mode with DPI scaling on, where 1px could be a fractional or integer number of on-screen pixels. Qt 6 only supports this latter mode. Qt 5 defaults to rounding the magnification factor (output physical pixels / input program-facing virtual pixels) to an integer (except on KDE where it's passed through), while Qt 6 defaults to passing it through as a real number. (Qt 5.14+ and Qt 6 allow apps to customize what rounding method is used, except on KDE where it's passed through no matter what your app requests.) Passing through non-integer scale factors causes Qt's Windows-style theme (and some apps as well) to break spectacularly with rounding errors left and right, shifting as you move your mouse and focus between widgets. Breeze and Fusion handle this better (in my opinion using hacks rather than logical principled fixes), but I still prefer integer scale factors where I'm guaranteed that each x-by-y rectangle is the same integer number of on-screen pixels (which is useful for creating correctly sized off-screen buffers and blitting regions between graphical buffers). All in all, if you drag a window between screens, Qt apps should handle it mostly fine. However, Qt doesn't properly respond when a display changes scale factor (like switching from laptop-only to external-only, or changing the scale factor of a monitor for testing), because Qt only checks for scale factor changes when the screen ID changes. Unfortunately Qt makes it hard for apps to properly handle changing scale factors. If you cache the size of text in pixels, or "64 px * current scale factor", then the app changes scale factors, the app will resize, but your cached sizes won't change. I think property binding is a good solution to this (easier to use than Qt's private events, or handling QScreen-changed or QScreen-property-changed signals), but Qt isn't currently built around property binding. Maybe in a few years, Qt 6 will port the long tail of APIs to QProperty... I can only hope... (Also Qt Creator's "new file" wizard somehow managed to have broken layout (too-small QLineEdit text fields) even when opening the app on a constant non-changing 125% scale. I suspect it's related to constructing a QFont without passing in a widget for context, causing it to use the global scaling instead of the current window's scaling. Or maybe it's because on Qt 5, Qt defaults to something like unscaled MS Shell Dlg 2 rather than scaled lfMessageFont.)
- joezydeco 5y ago
- rixed 5y agoAre that many KDE apps using QML (as opposed to qwidgets), though? Or does parent remark apply to both?
- yissp 5y agoAny idea why? I've heard Windows OpenGL drivers are less performant, especially AMD's, could that be part of the reason?
- pjmlp 5y agoQt 6 has moved away from OpenGL. Now they do like game engines and use the native 3D APIs from each platform. Which is to say DirectX on Windows and it is quite smooth.
- pjmlp 5y agoQt 6 is quite smooth.
- CarVac 5y agoI'm patiently waiting for it to become available in open-source repositories. I may need to set up some other way to use it for my builds…
- avrionov 5y agoQT 6.1.3 is available via vcpkg already.
- CarVac 5y agoThings are not so peachy over in Linux. I do see Qt 6 in MSYS2 though, so maybe I can use it only for my Windows builds.
- avrionov 5y agoYou should be able to use vcpkg on Linux too. It supports officially Windows, Mac and Linux.
- nyanpasu64 5y agoWhat Linux distribution? Arch Linux has shipped Qt 6 for months, and Qt ships a web installer too (but it requires a Qt account and doesn't install the shared objects in a global location that apps can find).
- CarVac 5y agoI'm interested in Qt 6 for Ubuntu 16.04 which is currently what I build my AppImages on.