What is the best library to use when writing GUI applications in C++? [duplicate] - c++

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Gui toolkits, which should I use?
I've got a fair bit of C/C++ experience - mostly for writing console application for Windows/Linux, and also a fair bit of C# experience - generally for writing WinForms applications etc.
I'm extremely impressed with with ease at which I can create a window in .net, for example something as simple as
Form form = new Form();
form.ShowDialog();
is enough to get a blank form up on the screen. In fact,
new Form().ShowDialog();
is technically enough as long as we don't mind losing reference to the form after it's closed.
I've tried writing some windows-based GUI stuff in C++ using windows.h, but not only does the learning curve seem a little steep but also the syntax is extremely verbose. Creating a simple window like the above mentioned single line .net implementation can easily exceed 2 dozen lines using windows.h.
But not only that, if I were to port the application over to Linux/Max (something which I can pretty much never do with .net, with the exception of hacks like mono etc), then I would need to rewrite 95% of the GUI code.
I'm assuming this is where frameworks come in, for example QT etc... (I don't really know much about gui frameworks, I'm afraid).
What GUI frameworks do you recommend? which are the most powerful and which are the easiest to use?
How do you generally tackle the task of coding your GUI in C/C++?

The closer to the metal (so to speak) that you are programming, the more difficult things get. WinForms (provided by the .NET Framework) is a pretty outstanding abstraction over the Win32 API, considering the complexity you've already seen that it involves for the even the simplest of tasks, like getting a window to appear on the screen. All of that is still happening in the background, of course (registering a window class, creating the window, etc.), you just don't have to write the code yourself.
It's interesting that you write off Mono as a "hack", but would consider a library like Qt. I'm really not sure on what basis you make the distinction. The Mono library is widely regarded as excellent when it comes to WinForms support. The biggest detractors are the same as Microsoft's own CLR implementation, namely that it doesn't produce truly native code, which is more irrelevant to performance in the majority of situations than one might think. Beyond that, some complain that Mono applications don't conform fully to the platform's UI guidelines (that is, they don't look and behave exactly like a native application would), but I have a similar complaint about applications written using Qt.
It seems like literally everyone recommends using Qt if you want to do GUI work in C++. As I mentioned above, it happens not to be my favorite library because I'm a stickler for using fully native controls and widgets provided by the platform you're currently running on. I understand that Qt has gotten a little better at this recently, but I still don't think it's up to my standards. If you're more flexible than I am (and I'll warn you that the average Mac user is not any more flexible than I am), and true platform independence is a big concern to you, it's probably the one you should opt for. Many people praise it for its design elegance and convenience, although I seriously doubt that even it offers the same simplicity as the .NET Framework's implementation.
If sheer simplicity and terseness of code is as important as the beginning of your question makes it sound, I highly recommend sticking with C# and WinForms. Things get harder as you start to remove layers of abstraction, and if you don't need the extra levels of control that doing so affords you, there's hardly any justification for making more work for yourself. Mono's Forms implementation is a perfectly viable solution for cross-platform applications, assuming your needs are relatively modest.
Beyond that, if you want to create a truly cross-platform application in C++ the right way, I recommend that you strictly separate your data layer code from your UI layer, and then write the UI using the tools provided by each platform you want to support. In Windows, your options are relatively open: .NET WinForms is a solid choice, native Win32 is a somewhat painful though merited option, and a handful of other libraries like MFC and WxWidgets can help to ease the pain of fully native programming (though not nearly as well as WinForms does). On the Mac, the only real option is Xcode, Interface Builder, and Objective-C, targeting the Cocoa framework. Linux/Unix-based systems are hardly my forte, but I'm given to understand that Qt is about as native a library as you can get. This sounds like more work than I think it is—a well-designed library should handle 80% of the work, leaving only around 20% that you have to do in implementing the UI. Beyond using truly native controls and widgets, I think the other big advantage afforded by this approach is flexibility. Notice how Microsoft Word looks very different (despite some superficial similarities) on Windows than it does on the Mac. And iTunes has become almost a paragon of excellent UI design on the Mac platform, but sticks out like a sore thumb on Windows. On the other hand, if you rolled out something like Windows Media Player on the Mac (and yes, it's been tried by Microsoft themselves, though without much success), Mac users will dismiss it as a complete abomination and probably be somewhat offended that you even tried. Not so good for the truly cross-platform-minded developer. All of that to say, if your app is anything but the simplest of utilities, you'll probably find that an entirely different interface is justified (and even expected) on each platform that you want to support.
No matter how great Qt may be, you're not going to get that with it.

Qt, hands down.
it's the most complete, most mature, fastest framework available. and on top of it, it's seriously multiplaftorm and your choice of commercially friendly open source or paid support.

Related

Building simple GUI without resorting QT or .NET using native C++?

Are there any platforms to build GUI platform without resorting to QT or .NET using native C++ ?
QT is cool, but take a lot of time to learn, in addition it has a lot of things I don't really need and really dislike QT IDE, compared to Visual Studio (I know you can use QT within Visual Studio)
.NET suffers same problem (I am actually learning C# and WPF right now, though it looks like WPF is somewhat easier to program and you can call native C++ code from WPF)
I am looking for something that is: relatively easy learn, does not have to have advanced features, works with C++11, support C++11 multi-threading, works with Visual Studio. Planning to build some applications for Numerical analysis.
There are lots of alternatives with varying levels of support in VS.
MFC has quite a bit of direct support in Visual Studio in the form of code generators, Wizards, etc. Unfortunately, the basic design is very old and hasn't aged very gracefully at all. Quite a few programmers not only would but do cite it as a prime example of a library that's better avoided if humanly possible.
WTL is Microsoft's other class library for producing Windows applications. It's a much newer design than MFC and generally considered much cleaner and nicer. As implied by the name, it's heavily template based, which helps it produce applications that are generally considerably smaller and faster than MFC ever attempted. For better or worse, Microsoft placed it under a fairly permissive open-source license some time ago, and updates since then have been quite minimal. Despite both being from Microsoft, Visual Studio has never done much to support WTL development.
wxWidgets started as more or less a clone of Microsoft's MFC, but has continued active development while MFC has mostly stagnated. It now has quite a few features (e.g., XML-based UI design, layout managers) far beyond anything MFC ever even considered including.
Ultimate++ is a fairly unusual toolkit that has mapped its own route (so to speak) that's quite a bit different from most others. They have their own IDE (TheIDE). Code can be quite simple and short, but is enough different from most typical C++ that many people find it difficult to grasp at first (and some experienced C++ programmers don't particularly like how some thing work).
GTK+/gtkmm is less of a Windows framework than a Linux framework that's portable enough to also work under Windows. It's probably not your best choice if you're developing exclusively (or even primarily) for Windows. These are also much more purely GUI frameworks than most others (i.e., they don't include things like collections, networking, cryptography, etc., that many others do include).
FLTK is another cross-platform toolkit. Its fairly small and fast, but somewhat like GTK+, it seems (at least to me) less like a Windows toolkit, than a Linux toolkit that happens to be portable enough that it can also work on Windows (but the results don't look or feel much like most Windows applications).
Juce was originally used to develop some music software (Traktion) so it includes a lot of music-oriented functionality. It also have some fairly unusual widgets that most others don't include (especially widgets that imitate controls you'd see on all sorts of audio equipment). Nonetheless, it has a solid core of basic GUI functionality, as well as the usual "extras" like network, crypto, XML and JSON, etc. Although I haven't tried to do anything like a full review of the code, it appears to be rather better written than most.
That's not a complete list by any means, but I think it hits most of the more popular/widely used GUI toolkits (other than Qt, of course).
Some time ago I asked myself exactly that same question.
I wrote my program using C++/CLI, which was not bad (my C++ code was very well isolated from the GUI/CLI part), but sharing the executable with others was a problem: it was the typical - it runs in my PC(...only). So, I needed a light alternative to the user unfriendly command line programs in scientific calculations, which I could easily share.
I am now happy to use Nana. Please join the group of users and / or developers of Nana and... have fun!
GUI with Nana C++ Library
Nana C++ Library takes aim at easy-to-use and portable library. It
provides a GUI framework and threads for easy programming with modern
C++ methods, such as traits, metaprogramming and other template
technologies.
Since you plan to develop exclusively for Windows, I think you should stay with MS provided GUI toolkits. While third party toolkits may provide the cross platform advantage you already said don't need, they add complication and dependencies.
Complication by for example when a new Visual Studio is released, then you have to wait for the toolkit to get that new VS supported, and dependencies, which means more dlls to be installed on the target system.
Plus some toolkits do not use the native look of the operating system, like many java programs for example.

What is the best way to get started in GUI C++ programming?

So, I learned C++ (fundamentals) and I want to write software, however I have stumbled upon a problem where I don't know where to get started. It seems like learning C++ was the easiest part by far when it comes to understanding the libraries for the GUI construction the concept I yet don't fully comprehend. I searched a lot and couldn't even decide been a new guy on MFC, Win32 or Qt.
Qt C++ GUI seems like a fun and easy to use software with the definitions of classes available right there quickly.
With Visual's MFC I am seeing a lot of code upfront on the pre made project file and a lot of description of classes, however getting definitions is a bit slower as I have to go to the internet.
Win32 is apparently written in C and is not updated much?
A lot of people recommend Java and C# as well, but I am not interested in learning a new language when I don't have C++ set in stone and practiced with enough yet.
Not sure how to go about this.
Go with Qt if you envision porting your program to platforms other than Windows and/or your actual UI needs are relatively straightforward. But Qt, being "fun," abstracts you away from the Windows API, so if you find yourself needing to access features of that API not offered by Qt, then you'll be up the creek. So go with MFC if you're staying on Windows and you're building an application whose complexity or Windows-specific features may require more direct access to the Windows API. MFC provides a thin abstraction layer over that API; its concepts map more or less one-to-one with the API's concepts.
What kind of GUI do you want? Any framework should be able to do any kind of GUI, but some are optimized for certain work:
MFC is optimized for making applications that edit documents, like MS Office programs Word, Excel, Powerpoint.
wxWidgets and Qt (and .NET WinForms and WPF) are optimized for any sort of app that primarily uses widgets (textboxes, buttons, menus).
SDL is optimized if you want to draw stuff, like graphs or vector artwork.
I wouldn't recommend that you use MFC since it isn't a good fit for most applications, and also doesn't use modern C++ design, it's loaded with workarounds needed for stuff that was broken in early versions of Visual C++ and now can't shake those workarounds because of backward compatibility.
The Win32 API is actually really useful to know regardless of what kind of application you want to make, because it defines the rules for how the UI interfaces to the rest of the system. Yes, it's written in C, but this is to make it usable from any programming language, not because it's an obsolete design. Win32 API is highly object-oriented and uses polymorphism extensively.
Few things you need to be aware of:
If one day you want to sell a program written using Qt you might need to purchase a license.
If you feel like GUI applications/ GUI programming is what you want to do in general, for windows platform you better learn WinForms or even better WPF (with C# of course).
If you just want to quickly put up simple GUIs for your C++ programs for learning purposes, and you don't care much about learning the frameworks and licensing issues, just go with Qt or wxWidgets.
MFC is outdated. If sticking with C++ on Windows, I recommend you to lean C++ CLI.
However I suggest you to learn c# directly since c# is the mainstream language in .Net world.
For GUI, the windows world is now dominated by WPF.

Alternative to MFC [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
https://stackoverflow.com/questions/149698/what-is-a-good-mfc-starting-book
A lot of the upvoted comments claim there are much better alternatives. I'd like to know what they might be.
My main requirement is that the UI use the native widgets so that our automation software can work. Owner drawn windows are much harder to drive.
I'm not particularly liking the design of MFC so an alternative would be good. Only one I've found is WX, which is the one we've already tried and are considering abandoning. We need something that doesn't force us to fight with a bunch of cross-platform wrapping we don't care about. We're writing a Windows application and marketing doesn't give one single crap about targeting Mac or Linux (yeah, it makes my butt hurt too).
I've looked at the .NET option a little bit. Problem is I don't know much about it but from what I can tell we'd have to use C# to get a lot of the options readily available with MFC. The C++/CLI toolkit doesn't seem to have docking windows on first glance for instance. In fact, a straight up WinFroms option doesn't seem to either. It looks like we'd have to make a WPF project and that doesn't appear to be at all what we really want (and we'd have a huge bunch of crap to learn besides just another toolkit). Moving out of C++ would also require a lot of wrapping and I don't particularly like the results I've seen from automated wrappers.
The other issue I have with the .NET option is that we've got a pretty drawing intense application (in addition to requiring a lot of forms). I know that you can get similar results with JIT languages like .NET but I also know you've got to be a lot more careful to do so. It's an issue I'd like to avoid worrying about at this time.
The other, and probably most important issue with .NET (at least switching languages) is that we've got a huge supply of interface logic that though should be API agnostic, is very much written in C++.
So what are the other options? Do these people really have points or are they just yelling against anything that isn't their favorite language or toolkit?
NOTE:
What is the issue here?? I said specifically that porting to other platforms is NOT even remotely a consideration and that I HAVE TO HAVE something that uses the native widget set so we don't have to completely change everything that testing uses to automate the product!!!! Did anyone actually read my question?
Qt is the only real answer for a C++ based gui toolkit at the moment (at least for full desktop apps). Even for purely windows apps it's worth it - it also has excellent integration with visual studio (get the vs-addin) and is very well documented
wx has some nice points, one being it's very similar to MFC in use, but with Qt going LGPL wx's real advantage has been lost.
Edit
Qt widgets aren't native HOWEVER they do use the native styling APIs so that they are indistinguishable from native widgets - if you use the default styles.
Windows forms will work just fine with C++/CLI. Windows forms also happens to be a wrapper around WIN32 handles.
There's no difference in the capabilities of C#/Windows Forms compared to C++/Windows Forms. (They just compile differently) Just like you can do the same things with C# and VB.NET...
If you're looking for docking windows, there are a number of third party libraries that do this. (Some are open source, some you can buy.) Because of the CLR, you can directly include assemblies written in a different language.
MFC wasn't bad in its day but it is getting a bit old. A good example would be the collections which have been replaced wit the much better STL collections. However you were asking about GUI stuff. There's the WTL (Windows Template Library) which I believe has now been open sourced. Much lighter footprint than MFC but it is designed to work the same way - eg. Most of the classes have the same names and method names.
On the downside I've found documentation relative scant and it doesn't seem to work well with the Visual Studio Wizards. This could be my problem though - getting it work with the VS wizards would be quite important IMHO.
I'm in roughly the same position: large app, native code, using MFC for the front-end. I don't see any really compelling alternatives, or reasons to switch to anything else.
That being said, let me offer an opinion. If I were doing a new project, which needed to preserve/inherit a lot of native code, I'd consider trying to do a WPF front-end with a largely native (C++/CLI) main application. This was done with Visual Studio 2010, and it's mostly performant, so it's at least possible. WPF has some UI benefits, and it might be easier to work on and test (from an automation perspective), since it is CLR code. I'm not sure it would be worth the investment and learning curve, but it's the alternative I would consider for a modern pure-Windows application with lots of native code.
Hope that helps.
To offer something I didn't see mentioned in the other answers:
From the sound of it, your only reason for needing native controls is that automation software. And the only reason for needing that automation software to work is for testing. I would assume some series of automated tests are being used to ensure the software works as intended.
If that's the case, then here is something to consider: There is a reasonably popular design pattern in the C#/WPF realm called Model-View-ViewModel. Without getting into excessive detail here, the basic idea is that you can separate the actual GUI controls (the View) from the code that handles how those controls interact with the rest of the business logic in the application. That code is the so-called ViewModel. Among other things, this lends itself to designs where that ViewModel (and all the rest logic of the application) can be tested through typical unit-testing methods without actually needing GUI controls to be present.
So whatever testing the automation software is used for could potentially be replaced by straight unit-testing code.
However, my own experience in this realm is not nearly as extensive as I would like. So if you consider this at all, I strongly suggest further research. As a start, googling terms like "Model-View-ViewModel" and "MVVM" should eventually yield some more detailed discussions about that part.
I've seen Qt used fairly extensively. I personally have not used Qt, but I see a lot of questions about it, far more than wXwidgets or MFC. I'd start with that.

Is anybody working on a high level standard library for C++

STL/Boost cover all the low level stuff.
But what about the higher level concepts?
Windows: We have multiple windowing libs
KDE(Qt)
Gnome
Motif(C but written in OO style)
MS Windows
etc
But is anybody working on a unified standard for windowing?
Something that wrapped all the above would be acceptable. (even if it only accessed the common stuff it would be a starting point).
Networking:
There are a couple out there (including the Boost low level stuff).
But is there anybody working on a Service based network layer?
All the other stuff that Java/C# have in their standard libraries.
The stuff that makes it simpler for a beginner to jump in and say Wow done and it works everywhere (nearly).
Anyway. Here hoping there are some cool projects out there.
Edit
Maybe there is not one.
But if there are a couple that could be bundled together as a starting point (and potentially modified over time (where is that deprecated keyword)) into a nice consolidated whole.
Note: Windows is just a small part of what I am looking for. The Java/C# languages consolidate a lot more under the hood than just the GUI. What would be a good set of libraries to get all the functionality in one place.
There are too big differences between platforms to get a definitive C++ standard for GUI programming. I think Qt is about as close as you will get in the forseeable future. wxWidgets is another popular choise, but as I understand it, they are using less modern c++ features.
As for networking, I think you are being kind of vague. If you mean web services over HTTP, I would have a look at Pion.
Well it is almost 2010 and C++ almost has threads.
I'll probably get slammed for this but C++ moves too slow - to its own detriment and its user base. I readily acknowledge the difficulty of the technical and political issues involved but that's still the dirty reality of it. The language can't build in higher level concepts when it takes 5-10 years to agree on and implement the building blocks.
The reasons for this have endlessly debated but the sad truth is that C++ has relegated itself to a niche language. I like C++ but I look at the progress C#, Java, and even Python and Ruby have made over the last 5 years and I increasingly question whether C++ is worth the effort.
The Poco C++ project aims to deliver all that you ask, except for Windowing:
The POCO C++ Libraries aim to be for
network-centric, cross-platform C++
software development what Apple's
Cocoa is for Mac development, or Ruby
on Rails is for Web development — a
powerful, yet easy to use platform to
build your applications upon.
Qt might be the only framework complete enough to be what you suggest.
I guess there's some kind of keyword lookup driving the advertising here because I'm seeing a REALbasic ad, which is what I generally use for cross-platform GUI's nowadays.
I have spent a lot of time over the last 15 years working in C++ GUI's including retailing my own portability layer for CodeWarrior PowerPlant and working on the two Macintosh-based GUI code generators, including adding Windows generation to AppMaker. I've worked with wxWidgets, mainly wxPython. So, my opinion on difficulties in cross-platform GUI is fairly well-qualified :-)
Cross-platform GUI frameworks are hard to the point of nearly impossible without significant compromise - the issues come down to subtle matters of behavior which generally bother users at a level where some of them can't quantify but know that the application doesn't feel right. This is a lot harder to fix than just rendering native controls.
I started using REALbasic because their framework does a better job of getting the feel right than anything else I'd tried (I didn't get into Qt because of the expensive commercial license).
The reason it has taken so long for things to evolve is nothing to do with the C++ world moving slowly, it's just an intractable problem. The very best cross-platform Java apps do some stuff conditionally for OS/X and it is still screamingly obvious to an experienced user that they are not a native Mac app, although some are very usable and come pretty close to looking native - Oxygen XML editor and DeltaWalker are two of my favourites.
I don't think it is achievable to make a really comprehensive portable GUI library. Operating systems are just too different. Can you imagine a GUI library that would cover everything from iPhone to Windows 7 and wouldn't feel wierd on any of them?
A Boost gui library comes up occasionally.
The general opinion seems to be that the problems is too wide (are you targeting cellphones, FPS games or CAD workstations) and that it is too much work - Qt/wxWidgets has taken 10years.
see http://lists.boost.org/Archives/boost/2005/09/94453.php for a discussion.
It would have been nice because GUI usually means cross platform and threads, so all the GUI toolkits have invented their own cross platform,filesystem and thread classes. On the other hand if a standard GUI had been introduced in C++ it would probably look like TK !
What's so great about standardization ? Sure, if novice coders want to download one SDK to build portable apps, let them download Qt (or something similar) and forever remain within it's fine walled environment. But it'd be a tragedy if the C++ world revolved around that one library and boost and POCO and wxWidgets and clutter and blitz++ and eigen and and 101 other wonderful things (yes, gtkmm and ACE even) were stifled at birth because the gatekeepers of The Standard Library didn't see fit to admit them.
Diversity is good I think (although when dealing with it, it helps to have a good package manager; I've spent hours setting up build dependencies on Windows which just needed a few seconds of apt-getting on Debian).
ACE is great for concurrent communication and networking.
For cross platform windowing, there's wxWidgets. (formerly wxWindows).
Only everybody and his brother, but hardly any of them actually get anywhere.

What's the C++ GUI building option with the easiest learning curve - VS/Qt/wxWidgets/etc.?

I'm looking to be able to build GUI applications quickly and painlessly as possible. I'm competent (though not expert, and have no formal training) in C++, but have never used a GUI building toolkit or framework or anything. I am not a professional programmer and am totally inexperienced and ignorant when it comes to building GUI apps. Have spent hours researching trying to figure out what to do; only getting more confused and discouraged though.
Qt and wxWidgets seem like the most popular options for cross-platform apps, though cross-platform isn't necessarily all that important to me; Windows-only is fine if that means the fastest learning curve.
Qt seems cool and the Qt Creator is sweet looking with lots of good demos, except it has its own classes for everything, and I'm not overly keen on learning a bunch of stuff that's only applicable to the Qt platform itself rather than more generally. I suppose I could avoid using the Qt classes except for the GUI stuff where I have to use them, but I have no idea how wise or unwise that would be.
I was thinking Visual Studio would have the smallest learning curve, but when I open a test GUI app, I see a bunch of foreign looking stuff like carats (^) all over the place - I found online that these mean "handles", which I have trouble even understanding the definition or purpose of ("sort of like pointers but not really" is basically how I've read people define them).
I know pretty much nothing about wxWidgets, or how it compares with Qt.
So every option has a big learning curve - and ideally I'd like to know which one minimizes the time you have to spend learning the toolkit/framework itself. Since I'm likely never going to be making money from the programs I create, the time I spend learning a specific toolkit would be pretty costly. I just want to be able to make a functional program using the C++ knowledge I have, but in GUI form. At the moment it seems if I want to make a GUI app, I'd have to spend way more time learning the GUI framework I'd use than writing the functional part of the app itself.
Any input from people wiser and more experienced than me would be appreciated :)
First and foremost, start simple. There's a lot to the subject. If you are finding it hard, don't try and take it in all at once.
Most of the good GUI packages have tutorials. The best advice I can give is that you try each of them, or at least a couple of them. They are the best short introduction you can have to the library you choose and if they are any good they narrow down what you need to absorb at first. That will give you some basis for comparison, because they are each trying to do very similar things (and you will see some of them before you are done), but they have different feels. You will likely find you have a preference for one and that's the one to get serious with. It will also give you a sense of what's hard about GUI programming as separate from the particulars of one package, which, if you have only used one, you won't have seen. Personally I find this sort of knowledge very helpful, because it makes me less intimidated by particulars.
Here's a list of tutorials in one place, though you have likely seen them already:
Qt's tutorial
WxWidgets' tutorial
Gtkmm book. Not quite a tutorial, though there are lots of examples.
.NET tutorials, either for WinForms or for WPF.
Second, it sounds to me that you need to get some in depth understanding of the concepts of GUI programming, not just a particular library. Here there is no substitute for a book. I don't know all of them by a long shot, but the best of the bunch will not just teach you the details of a toolkit, they will teach you general concepts and how to use them. Here are some lists to start with though (and once you have titles, Amazon and Stack Overflow will help to pick one):
List of Qt books
WxWidgets book (PDF version)
There are tons of WPF and WinForms books. I can't make a good recommendation here unfortunately.
Third, take advantage of the design tools (Qt Creator, VS's form building and so on). Don't start by trying to read through all the code they generate: get your own small programs running first. Otherwise it's too hard to know what matters for a basic program and what doesn't. The details get lost. Once you've got the basics down though, Do use them as references to learn how to do specific effects. If you can get something to work in the design tools, then you can look at particular code they generate to be able to try on your own hand-written programs. They are very useful for intermediate learning.
I'm not overly keen on learning a bunch of stuff that's only applicable to the Qt platform itself rather than more generally.
I second the comment of GRB here: Don't worry about this. You are going to need to learn a lot specific to the toolkit no matter which toolkit you use. But you will also learn a lot that's general to GUI programming with any of the decent toolkits, because they are going to have to cover a lot of the same ground. Layouts, events, interaction between widgets/controls, understanding timers -- these will come up in any GUI toolkit you use.
However do be aware that any serious GUI package is an investment of time. You will have a much easier time learning a second package if you decide to pick one up, but every large library has its personality and much of your time will be spent learning its quirks. That is, I think, a given in dealing with any complex subject.
I suppose I could avoid using the Qt classes except for the GUI stuff where I have to use them, but I have no idea how wise or unwise that would be.
You do not need most of the non-GUI classes of Qt to use Qt's GUI properly. There are a handful of exceptions (like QVariant) which you'll need just because the GUI classes use them. I found you can learn those on a case-by-case basis.
Which is the easiest to learn is really going to depend on how you personally learn.
Personally, I've found Qt to be the easiest to learn so far. The GUI classes are rather nice to use, but I've found the non-GUI classes to be excellent, making it easy to avoid a lot of common issues you'd normally get with a more basic API. The documentation is excellent, IMO, as are the books, the examples, etc. It's also being very actively developed, with a few new technologies coming in the near future (like DeclarativeUI).
I've found Visual Studio/Windows API/.Net to be a good bit more complicated to learn. The API documentation on MSDN is rather complicated and not really organized in a manner that I find intuitive.
I've tried learning WxWidgets a few times, but I've never liked the API documentation.
All this is just my personal experience, YMMV of course. I'd say just dabble in all of them and see which one takes you the furthest, it won't hurt to try multiple.
As a person who learned C++ through Qt, I can only say that they work very well together. C++ purists (like I have become) will find lots of things in Qt not to their liking (the moc preprocessor, e.g., and the continued absence of exceptions for error reporting), but looking back, Qt provided a very gentle introduction to C++ for me.
And if you're like me, you throw in a handful of boost libs in each Qt project, because we want to write "real" C++, not the softened thing Qt uses :)
I would suggest wxWidgets. To me, it's pretty intuitive and looks nice.
Code::Blocks was built with it, so check that out to see if you like the graphics.
There are also a slew of bindings for wxWidgets, such as wxPython, wxErlang, and others, so if you decide to switch off of C++, you can take wxWidgets with you.
I also use wxWidgets and use it all the time for Windows-only applications (the only downside is that wxWidgets is notorious for large .exe filesizes, which may or may not be a problem for you). I found it very simple to use from the start, especially when combined with a GUI designer (personally I use wxDev-C++).
I've never used Qt, so I can't speak to its simplicity, but I doubt the difficulty is on a vastly different scale than that of wxWidgets. However, what I can say is that no matter what API you use (wxWidgets, Qt, WinAPI, etc) your code will be "locked into" that particular platform, so don't worry if you feel that learning Qt will lock you into the Qt platform (because the same thing will happen with any of those APIs).
If you're working solely on Windows however, you may want to do a few simple programs with WinAPI first. That way you have a basic understanding of the lowest level of Windows GUI programming before you move onto Qt/wxWidgets. That said, if you're really into cross-platform programming, then don't worry about that and go straight into Qt/wxWidgets.
I can't intelligently comment on the learning curve aspect, but a quick survey of StackOverflow questions shows about twice as many Visual C++ questions as Qt questions. Probably means that there is a larger support group in place for Visual C++. Might make learning it a little easier if there are more folks to help out.
No matter what you pick, I am quite sure it won't be easy and painless.
Having said that, I know that in some schools they use FLTK because they consider it relativelly easy to learn. I have never tried it.
In my everyday work I use WTL which is as close to the system as it gets while still providing some level of abstraction over pure Win32. I am not sure if I would consider it easy to learn, though, especially given the lack of documentation.
I recommend codegear C++ builder (previously known as borland C++ builder) from codegear which comes with a 30 trial. The nicest thing about it is that the GUI provides you with components that you drop onto a form in a WYSIWYG fashion and make functional by adding code to handle the events it fires. It comes with a whole bunch of compontents out of the box and you can add 3rd party components to it too, like the awesome ExpressQuantumGrid from devexpress, or write your own. It's very powerfull if you know what you're doing but intuitive enough that a beginner can write a database CRUD application in about 20 lines of very simple code.
Since nobody has mentioned it yet, for the sake of completeness, have a plug for the Fox toolkit. This is the one I used last time I did any C++ UI work of my own volition. There are also binding for this to Ruby and Python (the latter being many years out of date, though).
In general, the choice of a toolkit for self-directed work comes down to personal preferences for
the layout manager style
the event handler registration style
How native the widget set looks/can be made to look
If cross-platforming is not necessary, try .net + msvs or delphi. easy, all-in-one, no pain.
Qt is the best option for you. It's the easiest to learn, the most elegant and powerful and it is completely free.
Visual C++: This is an IDE, but it comes with its own GUI library called MFC. MFC is an old library with many quirks and it is difficult to learn and use. Many C++ programmers use it on Windows because it comes from MS, it's fast and it's free if you buy Visual C++. Since VC++ is an IDE, you can also use wxWidgets and Qt with it, although in your particular case I would recommend Qt Creator instead.
You seem to have experimented with Managed C++. Don't use that, even MS recommends that you only use Managed C++ as glue between C++ and C#.
wxWidgets: This one was a strong contender up to the day when Qt became free for commercial projects. It was always in the shadow of Qt and it is known that the documentation is not very good and the API is not as easy to learn as Qt's. Cross-platform MFC would be a good way to describe it.
C++ Builder: Borland made too many mistakes with C++ Builder and ended up getting out of the dev tools business altogether. It was a good product and I originally learned Windows GUI programming in one of the first versions, but I won't use it any more. There are better options and it is too expensive.