I've only recently started with C++ but basically I'm interested in these things:
- Learning. Duh. I can't write any code if I can't learn it.
- Portability. I use Windows mostly at work and Linux at home. Most of my friends use Windows either predominantly or exclusively. I know people with Macs. I would like the option of writing code for all of them.
- Freedom. After trying a number of operating systems and operating system distributions, I've formed the opinion that the Free stuff is of a higher quality. Also I find it more morally acceptable. So I don't want to be restricted (by my library choice) to writing proprietary software.
- Commercial Might. Freedom. After trying a number of operating systems and operating system distributions, I've formed the opinion that a real quality product forms more readily with strong commercial backing. Red Hat, Novell and Canonical make flavours of Linux that appeal strongly to me - and what do you know, they're commercial vendors. Windows and Mac OS X are (proprietary) commercial operating systems, and they're good enough for most - this only serves to emphasize my point.
- A simple build process. I come from a scripting background, and I'm accustomed to having my changes applied the moment I hit save in a text editor - not having to compile. So having a very quick and simple build process is important to me. If I can use the same build procedure on multiple platforms (or by flicking a switch on a cross-compiler) I won't feel like I've strayed too far from the scripting world.
- Object-Oriented Programming (and other "oh look at me I know all the silly compsci 102 buzzwords"). The first language I was really comfortable with is PHP. Now, PHP is quite the powerful object oriented language, BUT most of the examples (and indeed, most of the documentation) completely ignores any Object Oriented features. Believe me when I say, all the facilities for that kind of programming exist in PHP - it's just that unless you're taught it formally, you will learn all the "wrong"/old things first like I did. Basically, I want to be able to participate in Object-Oriented Programming, and I don't mind having to work to figure out how to apply it - in fact, if I get to choose which paradigm I subscribe to, that's even better.
How does Qt stack up?
- 10/10. It's easier to learn than pure C++. (although you need to learn both to use it properly!)
- 10/10. I haven't had to do platform detection even once. Ever. I will have to when I finish my current project though, because there will be an option to wake up the display (Windows and Linux only, can't test on a Apple) when certain events occur in the app. But that's arguably pretty low level; you can write a text editor, web browser or game without needing a feature like that. My qmake project files are portable to all platforms without special software (ie without REQUIRING scons, cygwin or msvc, although if I wanted to switch to msvc there would be no problem)
- 10/10. Qt allows me to release my work under the GNU GPL if I wish, and this makes me happy.
- 10/10. Qt is backed by Nokia. Everyone knows Nokia. I own a fairly expensive Nokia with a bunch of Qt apps on it. Furthermore other companies like Google, Red Hat et al probably submit the odd patch now and then. You can't get much more commercial than this.
- 10/10 qmake && make. How hard is that? It works on Linux. It works on Windows. It even works on FreeBSD. I don't have to define anything or rewrite any project files or anything. It's idiotproof and it never goes wrong.
- 10/10. Although I can't break free of Object Oriented Programming when I use Qt, I can stray pretty far from it before the application falls apart. And when I return, OOP in QT is always waiting with open arms to welcome me back. Frankly, I don't mind having to use Objects of various kinds for everything. No matter what mood I'm in it feels pretty natural under Qt.
Qt overall: 10/10. ... As a C++ newbie, I've never tried another C++ library and I probably never will. I can get everything I need from Qt at this point; even JSON and SOAP and File Locking and ......
I'm quite capable of writing C code and I like plain C a lot. I'm looking into learning about doing GTK+. Not because of any dissatisfaction with Qt; after a bit of soul searching Qt seemed like the obvious choice (I chose the library, not the language - and then started writing it in its native language). No, I want to learn GTK because so many Free Software projects I'm interested in use it, and I'm interested in having the knowledge to contribute to them. Some very interesting projects include browsers and instant messengers (like Pidgin). Networking code is something I'm pretty well familiar with (lots of PHP time) even if it is in totally the wrong language so when some protocol problem happens in a software product I know what it is ;).
No, I've gone way off track now (but I'm retaining the digression). The point is that Qt has everything I was looking for in a library, including portability and a shallow learning curve.
The performance isn't as good as doing native API function calls directly, apparently - but I don't care! It's still VERY quick compared to most scripting languages (PHP is more than fast enough if you write good code and even sometimes if you don't!) and it's still faster than many "proper" programming languages. I'd rather finish the application in one year and have it take an hour to execute, than take ten years to write the same program to do that same job in 45 minutes (unless the slower version is a stepping stone, but bear in mind I'm comparing the abstracted model to the bare API paradigm).
For more information about how using a library can make an application faster, more stable and more fun to write, look here.
So for me personally the questions is not "Why switch to Qt?" but "Why move away from Qt?"... And there is absolutely no reason to do so at all. I'm hooked for now. I'll only be working with other systems if I happen to be hacking someone else's project.
Having not used MFC I can't possibly tell you that moving to Qt is the right thing to do, but I tell you: TRY IT. See whether it's difficult to learn to use it. See if it hurts your work in any way. If not, you win. I bet you would win :-P