4 ms·
Glad to see the update. Most people associate Qt with GUIs which is unfortunate. I see that when people think of Qt, they think of WxWidgets, Cocoa or MFC as a
by hannofcart 9y ago
Glad to see the update. Most people associate Qt with GUIs which is unfortunate.
I see that when people think of Qt, they think of WxWidgets, Cocoa or MFC as alternatives. No, I submit to you that Qt framework is a more elegant, easier to use alternative to Boost as well.
This is not to say that QtQuick or QtWidgets aren't solid. However, the success of these two modules ends up occluding the others which to me are the real gems from the QtFramework: QtCore and QtNetwork.
QtCore provides a solid event loop, the most easy to use implementation of the observer pattern via its signal-slot mechanism, robust threading utilities and a bunch of other utilities that make writing apps in C++ an absolute breeze.
QtNetwork for a series of networking utilities that are elegantly simple.
If I were to write a command line app or a database or server, I'd reach for Qt in a jiffy.
Qt is not just for GUIs!
- makmanalp 9y agoAlso the image/video stuff and the browser, all the stuff that's /so/ insanely annoying to make cross platform works without a hitch.
- j_s 9y agoIs there a quick link to supported media formats? I will see if I can find it. It looks like (as of early 2016 at least) it is platform-dependent, which makes sense but kind of takes away the appeal for me. https://forum.qt.io/topic/57675/which-file-formats-or-codecs-does-qmediaplayer-support/3 https://forum.qt.io/topic/57675/which-file-formats-or-codecs... https://forum.qt.io/topic/63110/list-of-video-formats-qt-supports/7 https://forum.qt.io/topic/63110/list-of-video-formats-qt-sup...
- makmanalp 9y agoEr, sorry, yes, the video /formats/ are unfortunately defined by the available media encoder backends, but it's more that I don't have to write any platform or media backend specific code to e.g. show video from a webcam, have a video player control, or record and save audio, etc etc. So your code remains the same, all you need to do is bundle codecs when shipping, or make sure you use formats that the default media backends of most platforms support. This might help: https://wiki.qt.io/Qt_5.5.0_Multimedia_Backends https://wiki.qt.io/Qt_5.5.0_Multimedia_Backends If you get a format that all of Directshow(win), AV Foundation(osx) and Gstreamer(linux) support, you're pretty much set. Something like mp4 container with h.264 video and mp3 audio is pretty standard these days.
- Jasper_ 9y agoI really wish QtNetwork was better. I recently went and had to replace QtNetwork with our own event loop because it is extremely unreliable on Windows. The only mention of this is a footnote in the API docs: http://doc.qt.io/qt-5/qabstractsocket.html#waitForBytesWritten http://doc.qt.io/qt-5/qabstractsocket.html#waitForBytesWritt...
- ambrop7 9y agoWhy would you use waitForBytesWritten if you want an event loop? Just do as the note says.
- justinclift 9y agoYeah. It also turns out that just having a Qt application running on a computer can tank network latency for all applications on the computer: https://bugreports.qt.io/browse/QTBUG-40332 https://bugreports.qt.io/browse/QTBUG-40332 There is a workaround, but developers have to know about it first. And it's such an unexpected and weird behaviour that 99% of developers don't. This was our fix (1 line of code), in case that helps anyone: https://github.com/sqlitebrowser/sqlitebrowser/commit/73946400c32d1f7cfcd4672ab0ab3f563eb84f4e https://github.com/sqlitebrowser/sqlitebrowser/commit/739464...
- nly 9y agoYup, i work on software with a Qt GUI and it took us ages to figure out why our daemon (no Qt dependencies) would experience latency when the GUI was open. For Windows users we now put this var in to global environment via our installer, and probably break other software in the process.
- justinclift 9y ago> ... and probably break other software in the process. You might also be fixing it for some too, if they're running other Qt applications. :)
- lossolo 9y ago> or a database This is not the best example. Qt has a lot of overhead in its event loop, threading, parallelism and containers implementations compared to alternatives. It's not the best choice as a base for high performance database.