4 ms·
It really bugs me that native toolkits, and even cross-platform kits like GTK+ or Qt, seem to reject testability. They want you to open a window and build a wi
by ReactiveJelly 3y ago
It really bugs me that native toolkits, and even cross-platform kits like GTK+ or Qt, seem to reject testability.
They want you to open a window and build a widget inside the window. The APIs for rendering to a byte buffer and injecting bogus input events seem kinda weak. If I make my own toolkit, I'll focus on that first. I don't want such a huge part of the app to be an untestable I/O leaf.
- throwaway2037 3y agoIn the case of Qt, this is simply untrue. Google "qt gui unit tests" and you will find plenty of content -- from Qt and blog posts with Real World cookbooks and stories. And, Win32 has a whole separate subsystem for unit testing UIs. Read more here: Win32 -> "UI Automation Test Library" Man, there is so much damn misinformation about Qt on HN. It is tiring. I don't understand the source of this misinformation. Part of it probably stems from their various licensing mishaps over the years that seeded a bunch of FUD. It's a ridiculously good cross-platform UI library. KDE would not exist without it! I don't work for them, but I have used the toolkit for years. Nothing beats it. Yes, it is huge, but it does everything you could ever need.
- ReactiveJelly 3y agoI used Qt4 for a few years and never found an easy way to run a widget outside the context of a window. Maybe I didn't check the docs closely, maybe it's better in Qt6. I stopped working on GUIs a while back. Fwiw HTML and xaml were just as bad for that.
- throwaway2037 3y agoIt is unbelievable what people complain about with GUI toolkits. Nothing short of "does not do my homework" seems to be the limit of complaints. Let's get this straight: You want to paint a widget without a normal window border. This is not normal. It would be difficult even using native UI APIs. Also, Qt4 was last released in 2011. That was nearly 12 years ago. Maybe... try again? Also, you can Google: qt widget without window border Plenty of hits.