11 ms·
Is Qt a good, modern framework for desktop application development for a beginner? If not, can someone recommend something else?
by b1gtuna 9y ago
Is Qt a good, modern framework for desktop application development for a beginner? If not, can someone recommend something else?
- nodelessness 9y agoI was researching a GUI framework for creating a desktop tool (that is a not very memory or CPU intensive). I felt that Electron was good enough. For the GUI framework it seemed like I can make do with Photonkit[1] and ReactJs. [1] http://photonkit.com/ http://photonkit.com/
- yorwba 9y agoIs your remark about the memory requirements about what the tool's functionality itself would consume, or the complete application (including the Electron runtime)? I was under the impression that each Electron application would require as much memory as an instance of the Chrome browser.
- nodelessness 9y agoYes. I was not building an application like Tableau or IntelliJ. I also was not building anything that had high performance requirements (which electron will definitely fail at) it was a CRUD app - the desktop version of a website with sync functionality. The learning curve and full fledgedness of Qt was not needed for me.
- the_common_man 9y agoElectron seems to be the preferred approach these days (much disliked by people who appreciate native apps). That said most Qt apps don't look native all the time either (it comes close enough)
- deleted 9y ago[deleted]
- k__ 9y agoGuess Qt gets more performance? But more often than not Electron is good enough and there are even approaches to get JS on the desktop with less memory consumption than Electron. https://github.com/pojala/electrino https://github.com/pojala/electrino https://www.nidium.com/ https://www.nidium.com/
- seba_dos1 9y agoWhy would you even want to use JS on desktop if you have other options available? JS is the choice on the Web, because it's the only choice. It's the choice on Electron, because you can share the code base with Web version or make stuff like editors targeted to JS developers, so they can hack them while using them. But otherwise, it seems like the only worse option you could use for desktop apps is PHP. Why are people doing it to themselves? Since we're in a submission about Qt: if you really don't want to touch C++ (which is kinda understandable, although C++ with Qt actually isn't that bad), Qt is very well supported in Python. Using them together is a breeze, and if you really do miss the craziness of JavaScript, you can still use it in QML :P And if QML is what you only care about, you can even wrap it with Rust.
- DiThi 9y agoJS is a pretty good option in many cases, easier to support in many platforms and arguably easier to develop and debug. What is not, though, is bundling a whole browser. A JS engine is a couple orders of magnitude smaller than a browser.
- seba_dos1 9y agoI've been a professional JS developer for a few years, doing both in-browser and node-based automation stuff (never desktop apps in JS though, thankfully). What I mean is that while new JS revisions are trying to catch up and become somewhat pleasant to write in, there's still tons of baggage of bad decisions from the past that make this language simply awful when compared to basically any other popular language - and those aren't stagnating either. Just in order to retain your sanity, you need to use several layers above JS to transpile your code - like JSX when you do UI or TypeScript when you do... well, anything. I believe that JS is considered easy only because you can get your first impressive results very quickly when combined with HTML and CSS, which makes it easy to not lose your focus when learning. That might make it a good language to learn in, say, primary school on IT lessons - of course, only if there weren't other, better suited stuff available targeting these cases specifically already. Anything else actually makes JS harder than, say, Python. Or Go. Or C#. Or Java. Or even C++ with Qt (although C++ is easily second worse). Or Rust. There's just so much stuff you have to keep in your head while writing JS, it's not worth it. But you have to let go of "I know it, so I'll use it, no matter how well suited it is" mentality, and that can be challenging.
- IshKebab 9y agoFor a beginner (that knows C++) I would think Electron is way more difficult than Qt. With Qt you just: 1. Download the Qt SDK, 2. Start Qt Creator, 3. Open an example, 4. Click Run. I wouldn't even begin to know where to start with Electron. There are so many web frameworks and they're all badly documented... whenever I have to make a website I usually start off thinking "Right, I'll do it the 'modern' way this time - with React or Vue... and Typescript.. and and do I need webpack? and...??" but there's so much badly-documented half-finished stuff out there I usually end up giving up and doing plain Javascript. Doesn't help that the modern web stack is a total hacky mess.
- cpburns2009 9y agoThis is definitely the state of things. It's funny how people talk as if writing a web application is somehow inherently easier and more efficient than native applications. It's most certainly not the case. You have know at least 3 mediocre languages: HTML, CSS, and JavaScript. And then a separate server-side language if you're not a JavaScript fanboy, most likely a templating language server-side, and maybe even a client-side templating language if you're into that sort of thing. I'd gladly take Qt with C++ any day even though I only know enough C++ to shoot myself in the foot with.
- blattimwind 9y agoFor a long time I thought that C++ was somehow a bad language (because that's the developer-talk-consensus, much like Java), but after I've written a decent amount (something like 100k loc or so as of now) in C++ I reversed my "opinion". C++ allows people to write code that requires intense study to understand (template magic etc.), but writing that code and getting it to work is very hard too, so there is actually very little of that around. Apart from that C++ is a good language which works well for developing applications (and Qt is a very good partner for it). And that's what really matters. (Another thing that comes to mind is that there is a huge amount of software for testing, analysing, introspecting and debugging C++ applications - I would say that most other ecosystems are lagging behind in that aspect)
- 9y ago
- baldfat 9y agoThe anti-Electron people's complaint isn't really the look as much as performance and mostly start up time. To me I sue several electron apps all day and they have held up well. RStudio VS Code Discord / Slack (Well slack has not been rock steady)
- pavlov 9y agoIt's a very good choice as long as you're comfortable with C++.
- nabla9 9y agoWhat that is supposed to mean? Qt has language bindings. http://wiki.qt.io/Language_Bindings http://wiki.qt.io/Language_Bindings
- oblio 9y agoYeah, but can you use it for any serious application while knowing 0 C++?
- seba_dos1 9y agoYes.
- pavlov 9y agoQt bindings seem very niche. I don't think I've ever seen a Qt project written in anything but C++ (or QML+JavaScript for simple apps). Maybe the bindings are good? I just don't know, and I'm suspicious of an approach that seems to be entirely outside of mainstream Qt practice.
- seba_dos1 9y agoYes.
- skibz 9y agoA sort-of left field suggestion would be to try Red [1]. I'm quite impressed with it, so far! However, I'm not sure how suitable it is considered to be for beginners. [1]: http://www.red-lang.org/ http://www.red-lang.org/
- baldfat 9y agoI would think Ring [1] would be a better fit int he comments since Ring has QT bindings. Ring and Red seem to have the same goal of making GUI programming easy. Personally the syntax of these languages drives my inner Lisp brain a little crazy. [1]: http://ring-lang.net/ http://ring-lang.net/
- meirelles 9y agoFor sure, Qt is great even for CLI applications (if the dependency is not an issue).
- fpoling 9y agoWe use QT for real-time data acquisition system. Works surprisingly nice. QT has good event loop abstraction and this is what C++ still lacks.
- 0xFFC 9y agoAwesome, I would love to read more about your systems. Do you have blog posts or something?
- fpoling 9y agoIn Norway it is a common knowledge that QT is a very reasonable choice for soft real-time. So I guess that is a reason people do not blog about it. One doesn't write about obvious things, does one?
- gusmd 9y agoAgreed! I use it at work for a CLI application that runs on an HPC environment. All the niceties that Qt as a framework provides (file system, multi-threading [mutexes, threads, semaphores, etc], JSON, shared memory, CLI arg parsing, even a State Machine!!) are a huge productivity boost.
- geezerjay 9y agoWhere's the added value of Qt's support for multithreading when compared with the C++ standard support for multithreading? IIRC, Qt introduces the irrelevant QReadWriteLock and that's it. In fact, the only upside of Qt's multithreaded support is that they were developed to serve Qt's very particular needs. Qt is awesome but one of its main problems is its insistence of duplicating standard components and coming up with subpar alternatives which are then forced upon developers.
- dkersten 9y agoQt (and QML especially) is, in my opinion, the best way to do any modern-non-web UI work. Its built on a hardware accelerated scene-graph allowing for smooth compositing and animation, QML is an easy to use means of creating your UI and connecting it to C++ (especially post-C++11) is trivially easy allowing for good solid high performance UI's. You can also use Javascript if that's your thing, but for large applications (or iOS where its interpreted) you will need to take care to not run into performance issues. For small applications, its not a problem though. Additionally, QWidgets, the old pure-C++ based UI libraries are still available too. It also bundles a ton of other stuff, an embeddable web browser, javascript engine, collections library, concurrency library, networking library etc.
- joshklein 9y agoI do agree, but only if we emphasize the cross-platform requirement and a single monolithic code base. I’d much rather write a lightweight desktop app in any of the native toolkits, but especially Cocoa/Swift, and do the heavy lifting parts outside of the GUI application. But you’ll still have to write a native Linux one, and QT is my front runner there. But I do recommend looking at the Xamarin stuff too. Depends on your needs and where you’re coming from as a dev.
- shmerl 9y agoWriting many native UIs can be a waste of time, especially if you need to maintain and update them.
- colejohnson66 9y agoIsn’t that what wxWidgets is for?
- joshklein 9y agoYes, but writing a cross platform UI for a single platform use case is a waste of time as well.
- 9y ago
- thdn 9y agoultimate++
- vog 9y agoSome alternatives are mentioned in this SO answer, but I think Qt is undoubtably the best option: https://stackoverflow.com/a/1186038/19163 https://stackoverflow.com/a/1186038/19163
- sevensor 9y agoIf you want to use QWidgets, I highly recommend PyQt for beginners. PyQt is a very well done set of Python bindings. With rare exceptions, the Qt behavior and docs map straight over. E.g. if a method takes a QString, you can send it a Python string and it just works. It's dual-licensed GPL, so you do have to pay for it if you're selling something, but it's worth supporting the small company that produces it.
- tux1968 9y agoTo be slightly pedantic, you are not required to pay for it just because you are selling something. The requirement is only that you comply with the terms of the GPL license by releasing source to any modifications that you ship.
- cpburns2009 9y agoBut by it being GPL, you also have to release the source code of your potentially proprietary code as GPL. It's LGPL where you only have to release the modifications to the library.
- dkersten 9y ago> It's LGPL where you only have to release the modifications to the library. Even then, only if you dynamically link to the library.
- jacoblambda 9y agodon't you mean statically? I assumed dynamic linking was largely regarded as exempt from GPL
- dkersten 9y agoLGPL: If you statically link to an LGPL library, then the entire codebase (your code and the library) must be covered under an LGPL compatible license. If you dynamically link to an LGPL library, then only the library must be under an LGPL-compatible license (ie if you modify the library, those modifications must be made available), but your own code that links to the library can be under any license you wish. This is because the LGPL considers statically linking as a single work, while dynamic linking as multiple works, which can be licensed independently. GPL: Regardless of linkage, your code must be under a GPL compatible library. The GPL considers the software as a single work regardless of linkage.
- jackmott 9y agowhat does modern mean, and why does it matter, if it is good?
- ptero 9y agoIMO it is not, but it really depends on what you are a beginner in. If you are comfortable with C++ and both traditional and event driven flows, Qt is worth a look -- you may love it or hate it, but you will have something to compare it to and know enough to form your own opinion. Otherwise, pick at least 3 different languages/toolkits and implement a simple application in each to be aware of different ways of doing the same thing. Repeat for a different simple application. This vaccinates you against taking a model of your first toolkit and using it as the only way to solve every problem. That said, Qt is a solid cross platform toolkit that you can use it to write robust applications. However, it severely locks down your choices. If you use it, force yourself to at least be aware of other options. My 2c.
- pas 9y agoIt's a hard question, because on one hand nothing beats the next-next-finish install and setup experience of Visual Studio with C# on Windows, but it gets you exactly nowhere. (Okay you can make pretty programs that have a lot of buttons, input boxes, dropdown lists, and so on.) But that's a very good place to be, because then you can start branching out depending on what you find interesting. Do you want to make cross-platform things? Sure, try this https://github.com/picoe/Eto https://github.com/picoe/Eto (or these http://www.mono-project.com/docs/gui/ http://www.mono-project.com/docs/gui/ ) Do you want to be closer to the metal? More OpenGL? Go C++ or Rust ( https://github.com/rust-unofficial/awesome-rust#gui https://github.com/rust-unofficial/awesome-rust#gui and https://github.com/rust-unofficial/awesome-rust#graphics https://github.com/rust-unofficial/awesome-rust#graphics ) Do you want less setup for your users? Go the Electron way, and/or eventually just build Web Apps!
- jcelerier 9y agoLook at the example here and make up your mind on your own: http://qmlbook.github.io/en/ch04/index.html http://qmlbook.github.io/en/ch04/index.html