5 ms·
If I want to write a cross-platform GUI application supporting a single introspection, threading model and signals/slots mechanism for all members, then I'm ask
by pzone 10y ago
If I want to write a cross-platform GUI application supporting a single introspection, threading model and signals/slots mechanism for all members, then I'm asking for a jungle, not a banana. What parts of Qt would one want to split out and use separately? C++ stdlib collections not thread safe by default and cannot be used as drop-in replacements for Qt's collections. Qt's collections are designed specifically to work nicely inside its general framework, but would come at a speed cost used naively in some other sort of project. Also keep in mind that Qt is much older than C++11 and is just now switching to the standard library for its backend where possible. You can still use a non-c++11 compliant compiler with Qt 5.6 and utilize QThreads.
It reminds me of the argument that systemd is problematic because it's too big and complex. Well, sometimes it makes sense to write a complex system for the sake of ensuring that many complex components interoperate with ease, and system-wide changes can be coordinated between the libraries.
- vetinari 10y ago> What parts of Qt would one want to split out and use separately? That's the wrong question. The right question is: what are you going to do, when you need to use 2-3-4-5 libraries and each one of them insist on using it's own primitives, collections, object hierarchies, etc. Are you going to spend your youth just writing shims to marshall data among them?
- msbarnett 10y agoIs that a problem that anyone shipping products built with Qt is actually running into, though? Yeah, it's a GUI App Framework, not a GUI library. Yeah, it would be hard for 2-3-4-5 App Frameworks to co-exist. But how often would that ever come up? Frameworks, unlike libraries, aren't intended to be mix-and-match. Complaining about that is like complaining that water is wet.
- to3m 10y agoI don't know how much C++ you've done, but your "Ahah! BUT WHAT ABOUT" scenario sounds exactly like virtually every C++ project I've worked on. You have N libraries, and each library has its own string class and templated array class, all with different member function names. The answer to your question is: yes. Usually you're going to do some transformation or processing when moving from one type to the other, so you just fold the conversion into that. It's stupid and you roll your eyes and you just kind of carry on.
- vetinari 10y ago> scenario sounds exactly like virtually every C++ project I've worked on That's exactly the point :). It is not only C++, but also C problem. Maybe I've grown coddled with Java, Python and a few other languages, where the third party libraries do agree on the types they use.
- netheril96 10y ago> C++ stdlib collections not thread safe by default and cannot be used as drop-in replacements for Qt's collections. I agree with other parts of your post, but not this. How is Qt's collections thread safe in any way? And won't that be a huge performance cost, since most of the time, collections do not need to be thread safe?
- dalke 10y agoThey are not (generally) thread safe. Quoting http://doc.qt.io/qt-4.8/threads-reentrancy.html http://doc.qt.io/qt-4.8/threads-reentrancy.html > Many Qt classes are reentrant, but they are not made thread-safe, because making them thread-safe would incur the extra overhead of repeatedly locking and unlocking a QMutex. ... > Some Qt classes and functions are thread-safe. These are mainly the thread-related classes (e.g. QMutex) and fundamental functions (e.g. QCoreApplication::postEvent()).