Live data from Hacker News

Ask HN: Smoothness and performance of Qt based systems vs. native apps and OS

news.ycombinator.com

61–70 of 77 posts

Re: Ask HN: Smoothness and performance of Qt based systems vs. native apps and OS

#61
post #12

Earlier quoted context omitted.

You mean to say Telegram is smoother than other apps? Will try it out. In general, would you say that Qt is supposed to work just as buttery smooth and native on Mac or iPhone as a native app? And will an OS built on Qt like Ubuntu Touch will be as smooth and beautifully craftable as iOS apps on iPhone?

> You mean to say Telegram is smoother than other apps? If those other apps are using Electron then yes; Telegram is smoother. > In general, would you say that Qt is supposed to work just as buttery smooth and native on Mac or iPhone as a native app? Yes. No difference in RAM, Disk, or CPU usage than any other native app. > And will an OS built on Qt like Ubuntu Touch will be as smooth and beautifully craftable as iO…

If you observe the Ubuntu Touch videos on YouTube, you will find that the animations, the graphics are not smooth and seamless, they stall, they freeze, they lag. Do you reckon it is more due to low end hardware underlying those phones as opposed to a fundamental problem?

Re: Ask HN: Smoothness and performance of Qt based systems vs. native apps and OS

#62

I wouldn't go calling .NET a "native SDK" for Windows. That's like saying Java's a native SDK for Windows or macOS or Linux.

Why?

  > "That's like saying Java's a native SDK for Windows or macOS or Linux."
Not an unreasonable claim if you're packaging with Graal's native-image tbh.

Dotnet has NativeAOT, and JVM languages have GraalVM (with Kotlin Native too for Kotlin, and Scala Native too for Scala).

What you get when building an application with Dotnet Native, GraalVM native-image, Kotlin Native, Scala Native, etc, is architecture-dependent native code identical to compiling with "CC myfile.cpp"

So I don't find that unreasonable tbh.

If I can use NativeAOT/Dotnet Native Exports on .NET/GraalVM on the JVM to do this, as well as export a static/dynamic lib with a C ABI that I can use on whatever OS from C/C++/Rust code or whatever, I really don't know what else you need to call something "native" tbh.

Re: Ask HN: Smoothness and performance of Qt based systems vs. native apps and OS

#63
post #48
post #40

Earlier quoted context omitted.

i had the api reference open as i was trying to automate something in kwin... https://api.kde.org/frameworks/kuserfeedback/html/index.html https://community.kde.org/Policies/Telemetry_Policy

Which indicates it's opt-in so off by default. Also there's a pretty clear (IMHO) configuration in the settings that states what is send based on the level you select. So what's the problem? It's only a way to contribute usage feedback if and only as much as you want to.

This is correct. KDE's user feedback collection is:

* Opt-in.

* Has several different levels of sharing and pretty clear about what is being shared.

* Even at the most relaxed level, it's fully anonymized.

The only criticism I've heard about it a long time ago was that even if you turn it off, it still will collect the data, locally on your machine. Which was a technical matter at the time and may have already changed.

KDE people are among the most privacy respecting bunch. Grandparent is spreading FUD (or has been misinformed as result of FUD). In a world that people are comfortable with Facebook and Google I find it funny that people would have privacy complaints about KDE.

Disclaimer: Used to be a minor kde contributor.

Re: Ask HN: Smoothness and performance of Qt based systems vs. native apps and OS

#64

Earlier quoted context omitted.

Yep, 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.

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

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

Re: Ask HN: Smoothness and performance of Qt based systems vs. native apps and OS

#65
post #50

Earlier quoted context omitted.

QT 6.1.3 is available via vcpkg already.

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

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

Re: Ask HN: Smoothness and performance of Qt based systems vs. native apps and OS

#66

Earlier quoted context omitted.

What's wrong with KDE plasma? The beauty (and curse) of Plasma, is that it's so configurable, you can make it look and feel like anything else.

Admittedly haven't tried KDE in a few years but I don't like their apps and although I think the UI has come along quite well when I tried it last I thought it was very ugly at first boot. I have never needed a KDE app since I've used Linux. So the idea of running a DE that has developed a million apps I don't need instead of putting that dev time in the DE itself has always been a put-off for me. Crucify me for this…

KDE does have a long tail of (more or less maintained) apps, but there's nothing stopping you from installing the WM and plasmashell alone, along with a small selection of apps like Dolphin and Konsole. (You will spend a lot of disk space on KF5, and you might want to avoid Akonadi-based PIM apps too.) Do you think KWin/plasmashell is bad software (admittedly KWin has bugs, and plasmashell is worse off for being based off QML/JS and using janky drag-drop interfaces instead of traditional widgets), or are you avoiding it just because developers spend effort on apps?

You could try liquidshell as a plasmashell replacement, but I didn't like it (can't right-click to customize the panel, no Windows 7 style taskbar-dock IIRC).

There's Deepin too, but that's developed in China (which might be fine) and comes with a suite of applications (you probably won't like it either). I don't understand why you're fine with GNOME or XFCE though, since they also come with a suite of applications (GNOME has a file manager, text editor, terminal, IDE, browser, and VM GUI, and XFCE has a file manager, text editor, and terminal).

Re: Ask HN: Smoothness and performance of Qt based systems vs. native apps and OS

#67

My personal experience in using QT apps is that they load / render perceptibly slower than the native UIs and QT applications are slightly bulkier in size (storage space and memory). This is kind of understandable as QT emulates the UI through its own library (unlike, say, Lazarus IDE / Delphi GUI library that directly use the native UI library). However, size doesn't matter much today, and the very minor rendering d…

Not sure why you're downvoted. Even as someone who likes Qt, I definitely noticed that apps like XNView MP load slower than Win32/MFC apps (a few years ago on an older computer though).

> nothing outperforms the native libraries in terms of usability.

Win32 apps by default have hard-coded widget positions, which can't scale dynamically to larger fonts (though you can try DPI scaling, which is a choice between "blurry" and "text sometimes overflows the hard-coded widget sizes"). Though I don't like how sloppy Qt apps with multiple resizable widgets in a row have strange scaling breakpoints caused by various size policies and [minimum] size hints, and Qt apps tend to stutter when resizing.

Re: Ask HN: Smoothness and performance of Qt based systems vs. native apps and OS

#68
post #23
post #20

I find Qt is on par with native apps. Didn't even know it wasn't considered native. Electron apps on the other hand are very obvious from their resource usage, general laggyness and slow startup time. Say compare Discord (Electron) to Telegram (Qt) and it's like night and day.

Eh, I don't think it's always obvious - for instance Visual Studio Code I would never have guessed was an Electron app.

Even on a very powerful modern machine you could probably tell the difference by looking at "abnormal" RAM usage.

Re: Ask HN: Smoothness and performance of Qt based systems vs. native apps and OS

#69
post #58
post #54

Earlier quoted context omitted.

That distinction of "flatly obvious" versus "obvious on a decade-only mid-range PC" seems to be pedantry. The parent comment doesn't say "flatly", for instance. In fact, it says "I find" which suggests personal experience, which would then mean that they weren't making a generalizable ("flatly obvious") claim. Regardless, choosing the average consumer PC for your country (including the lower-class) is a much more rea…

Well it’s not extremely obvious to me that VSCode is an electron app on my low-to-mid range laptop, but maybe I’m just an idiot.

Or maybe, more likely, the prevalence of electron apps lowered the average expectations?

Re: Ask HN: Smoothness and performance of Qt based systems vs. native apps and OS

#70
post #3

In my experience QML is buttery smooth on Linux, even on older hardware, but it just isn't as smooth on Windows.

Yep, 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.

Are that many KDE apps using QML (as opposed to qwidgets), though? Or does parent remark apply to both?
Post reply on HN