Guys I study C++ for a second year. Till now I was doing only console app but I think it's a time to start programming in Windows. There are few alternatives and Qt is one of them but I'm also drawn towards pure Windows API - for more power of course. What would you suggest?
I depends on what you want to build.
Qt is a very clean and powerful API. It has a very nice object model for both GUI and almost everything else you can think of. It's also very extensible.
The "pure" Windows API, when I saw it, was mostly a lot of Visual Studio created macro's and such, not nice to read at all. It may be different now, of course. But I feel that if the C++ API were that clean no-one would have bothered creating C#.
So I would suggest you define a smallish GUI project with all the facets you want to be using (DB? XML?) and write that in both "pure" Windows and Qt, and see what you like most.
I think you'll find that, as always, power comes at a cost. And it's up to you to decide whether that cost is worth it.
Qt is a great platform to start on, it gets your feet in the door for intelligent ui programming and has lots of great power tools (like QPointer classes, etc...) to give you a base API for programming efficiently in C++
It's not the only one out there ofcourse, but it's a good framework and your software will be cross-platform out of the box as long as you dont do OS specific stuff on the side.
Can't really compare insightfully on the pure Windows API but one obvious difference is that you're effectively bound to one platform with the Windows API.
Qt is cross-platform for free (and is very mature, fast, well documented, has good support tools, ...).
I've used Qt 4 for a couple of smaller projects and I was thoroughly impressed with the clarity, consistency, and simplicity of the APIs. After a couple of hours of reading the documentation I was able to start writing GUI applications which were more robust, higher performing, and easier to maintain than comparable Java/Swing programs.
If you're interesting in gaining some breadth of experience then I'd recommend picking a small project and trying to implement it in a few APIs, see what suits you.
Qt is terrific if you want something to be cross-platform. It is very robust and extremely well documented. It also has a decent IDE to help you rapidly develop GUIs. I'd say you should at least take a look at it if there is a possibility you'll ever want to use the code anywhere but windows. I've used Qt a bit in the past and it is an extremely good package.
Really, you should probably look at both and weigh your options. Qt is cross platform, Windows API is not. Windows API has Visual Studio and can develop GUI's extremely quickly. Qt has it's own IDE that is good, but not as good as Visual Studio for rapid prototyping. With Qt, you have to make sure the people using your software already have Qt or statically bind the runtimes which increases the size of the executable by a lot. Windows API you don't have to do that, but again, it only runs on Windows.
Decide what you want to use it for, then choose what to look at. Both are very good to learn.
I strongly suggest going the Windows API route.
This is what I did. I learned the ins-and-outs of the Windows API, and later learned Qt.
The advantages of this are:
- Practical experience with an API
- Appreciation for "the hard way"
- A more in-depth understanding of interacting with hardware
Note: Qt does not use native controls of the host OS, so there will be inconsistencies between a Qt app and a Windows API one.
Qt is actually more powerful than pure Win32 API. Part of the reason is that Qt uses its own widgets (it just draws them in the same way native widgets are drawn), which lets it implement additional features which stock Win32 widgets don't have.
Design your applications with a division of responsibilities, and keep the GUI separate from the rest of the code. Doing both Windows and Qt at the same time will give you a good example of how this works out in practice.
I guess you already decided to go with win32 API. This is a mistake IMHO. As far as GUI API's go, win32 is ancient, convoluted, and really won't do much toward helping you learn modern UI development. May as well write in X Intrinsics.
Of course, I wouldn't go with Qt either. Qt extends the language unnecessarily. There are several other options that do not do this. wxWidgets, FoX, and gtk-- to name three. Out of those I would recommend GTK-- simply because it uses a nicer interface for events in my opinion.
I've used both pure win32 API (building my own event loop and handling messages) and Qt. I'd say win32 API is handy if you need really low-level stuff but it's a real pain to construct anything that's more than a few buttons and controls. It has it's uses, for instance when you need to prepare a window to be used for Direct3D output or a single notification area icon, but doing more is complex and requires quite a lot organisation from the programmer part. Not to mistake pure win32 API with MFC though.
Qt on the other hand is a breeze to create UIs and whatnot. It has a solid, well documented and quite intuitive class library. Simple and trivial tasks are actually simple and trivial, but it is easy to miss the internal details which might get back at you later. Or might not. I'd recommend Qt as a native GUI framework any day.
And it gets us to the point where win32 API is just an API and Qt is a framework. If you're in academia, it means you want to learn how stuff work. And win32 API will let you do just that - learn intricacies of GUI programming, most likely the hard way. Qt abstracts quite a lot of the internals away.
Therefore I suggest giving Win32 API a shot so you have a an idea how things really work at the heart of your GUI application and maybe move on to frameworks (I personally recommend Qt) if you need to build something more complex.
Yes, you should. Qt 4 is the most flexible and most powerful C++ GUI toolkit I ever encountered, and it is also very clean. IT is also cross-platform and isn't tied to single platform. Download Qt 4, and run qtdemo. It will show all available technologies. With all due respect to other toolkits, I haven't seen anything even remotely similar implemented in pure winApi, GTK, FoX, or wxWidgets. I doubt you'll have any questions after seeing that.
Well, it's an yet another suggestion - Yes, you should learn Qt. My point is - it's clean, well documented and can be ported across multiple platforms. Since you have learnt C++ for the past 2 years, moving to Qt will be quite easy. I mean it. And also Hey LGPL is available. Just download it and learn. IMO learning Qt is quite easy and enjoyable too..