Alternative to MFC [closed] - c++

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.

Related

C++ cross-platform framework for mobile app development [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Questions asking us to recommend or find a book, tool, software library, tutorial or other 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.
Improve this question
I'm planning on developing mobile application for both iOS and Android and I want to use C++ for the development.
Which cross-platform framework is available for building mobile application using the C++ language.
I'm sure a lot of people have this question as well, so read this if you'd really like to know the answer. Marmalade is probably the BEST solution. Code once, deploy to mobile devices, desktops, even some TV's. Many popular games have been created with Marmalade.
Extensive games like:
Lara Croft and the Guardian of Light
Call of Duty: World at War Zombies
But also simple games like:
draw something.
Doodle Jump
They've added a free package. You can create your game for free and if you want to get rid of the ad splash screen, it's $150,- per year for mobile devices or $500,- per year for other devices as well.
A big advantage is the native speed. It doesn't matter what people claim about other languages like javascript or java (and unfortunately Qt, which of course isn't a language but you know what I mean) running as fast as C or C++. It's simply not true. For simple applications this is of course not important, but when you're looking at (simple) games, this is crucial.
At the moment version 7.3 is available, but this version has a problem with the ARM emulator. I would download 7.0.
Whether you choose Marmalade or not, make sure you read the documentation. You don't want to end up missing some functionality and switch to another option when you're almost finished.
I've looked into portable code between Android and iOS before and I don't think it's possible.
To release apps into the Android market it needs to be in Java, and anything with a GUI on iOS needs to use Objective-C.
You might be able to have partial portable C++ layer, but in reality it's probably quicker to write the same app twice in Java and Obj-C than it would be to write it once in C++ as a portable solution.
Qt or Wx-Widgets might have some support, but I have not looked into mobile platforms for these, and I suspect the reality is that Apple, Microsoft and Oracle want you to be tied into their technologies these days and have no incentive to make things portable.
C# and Java provide a complete framework that allows code to be written much quicker using well documented classes and libraries, especially when dealing with user interfaces.
C++ on the other hand relies on many open source projects that take a lot of effort to get functioning on multiple platforms, and much time is spent dealing with subtle platform problems.
My suggestion was simply that it might be easier to pick a language better suited to the platform you are dealing with, as C++ tends to be lower level than other languages, the syntax can seem verbose and many hours can be wasted trying to make things work that you would expect to just work, and unfortunately documentation for many open source projects is poor.
Maybe this can be considered to be an opinion, but then the shift from C++ to C# or Java commercially might also indicate that I'm not the only one believing this.
You can take a look on openFrameworks, maybe it fits on your needs:
http://openframeworks.cc/about/
There ARE solutions for C++ cross-platform development for Android and iPhone, despite what other answers say here.
The best is probably Marmalade, but it's expensive, so only useful for commercially viable apps: https://www.madewithmarmalade.com/
Then there's MoSync, which you can use for free. Unfortunately they went bankrupt last year, so there's no ongoing support. Still, might be worth a look depending on your needs. http://www.mosync.com
OpenFrameworks is one I hadn't seen, so thanks Rodrigo for that answer: http://openframeworks.cc/
There is no cross platform solution using C++, unless you're interested in making games. There are a few options available if you don't mind using another programming language. Take a look at Titanium SDK (Javascript), Xamarin (C#) or the multitude of HTML5/CSS/Javascript frameworks (Phonegap comes to mind).
Look for the DragonFire SDK it allows you to write apps and games in c/c++. Not cross-platform and never used it but looks good. It uses Visual Studio and has its own simulator for iOS development.

Where to start and what to choose for a simple gui project in c++? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I know this question has been answeared before, since i rad most of the answears already, but they didn't fully address what i was looking for, also i'm trying to get a heads up really really case-specific, since i need to develop an app really fast and i have almost no G.U.I. experience, so here is my problem:
I need to develop an application wich allows the input of some text fields (actually a database support-like would be awesome) and i need to store the inputs (like in a database, a .txt file could be good too if it would fasten up the developing)
once the input are fully stored (some text field must be unique) i need to pull some data from the database.
the final intention is to code a simple "random winner extractor" by simplying assigning a list of "number" to each entry and then calling the rnd function i will check who is the winner.
in addition to this i would love to be able to add a little animation to the whole gui (a gif would be enough)
Coming from vb6 Gui developing (that's the only G.U.I. developing experience i have so far) i searched from some good "drag and drop visual gui framework" and i bumped up into QT and into the .net Framework for visual c++ 2010, and i must admit i like them both, but i have no idea where can i get the Heads up to start coding in them... for example i have no idea how to change a text field value, or how to call the equivalent of "onChange" javascript handler for any of the forms (in neither the Qt or .net framework)
since i'm a little rusty with actual Event handlers and api codes,here are my 2 questions:
1.Between .NET and QT, for the sole realization of this single application, wich will be run in a windows computer, based on the "simplicity to learn and develop" wich should i choose?
2.Given the answear for point 1, where could i get some reference or material on how to easly understand the basics? (all the tutorial i found or tried so far gives me only case specific knowledge, but they won't cover overall function i need to know, like how to display a message box, or how to interact with the object values, or how to write down the values into a file...)
C++ is more difficult than C#. But it is more flexibel. C++ is an independent standard. C# on the other hand is safer to use.
Qt is cross platform. It can be used almost everywhere (except web applications) easily. .NET is for Microsoft and Windows only but common on that platform.
Qt is easy to learn and it is powerful. .NET is also powerful but I experienced .NET being harder to learn than Qt.
Qt is open source while .NET is closed source.
Pick the points that are important for you. I think the main question you should consider is: Do you intend to create a cross-platform application (today or in future)?
PS: Normally you should not ask such questions here since they tend to start endless discussions. The above is my personal opinion and hopefully it will be taken as subjective without the need of commenting it.
"Simplicity to learn and develop" is kinda subjective if you think about it and can rely on what you feel more comfortable with I think. I don't know much about .NET but you said you have a background in VB so maybe .NET might be the best approach for GUI development for you. If you know your way around C++ better, QT is surely the way to go, it's fast and powerful. I can't give you any reference material for .NET but you should definitely start with the qt documentation provided online. If you prefer to learn from video tutorials you can check out the Void Realms Qt youtube tutorials. The videos target Qt 4.7 if my memory serves me correctly but alot of the stuff he teaches are still more or less applicable with the newer versions of Qt. And finally, if you look in the examples section of Qt Creator (or online as well), they are some examples that are tutorial style and they can teach you some core concepts of Qt like the signals and slots system for one.
"simplicity to learn and develop" is what .NET is for, especially for database apps. But to get that simplicity use VB.NET or C#, not C++.

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

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.

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.

Do you use Qt and why do you use it? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Pros. and cons? how long do you use it? What about jambi?
I have been using Qt for several years now for commercial development and have been very happy with it.
One of the nice things with Qt is that it provides a large set of libraries as well as the GUI stuff (eg XML parsing, threads, networking), all in a consistent style and all multi-platform. This means we rarely need to use other libraries, though we do use boost for some things.
Another very important factor for us was internationalization. In a previous, MFC based application we had to maintain 2 localized versions, for the two languages we support. In our Qt based app we just have the one version.
The Qt translation system, using linguist is easy to use and makes supporting multiple languages easy (of course you still have to translate the strings which is a lot of work!)
The GUI layout system where the widgets resize themselves according to a layout makes everything much easier. In different languages the length of the strings are different. With fixed size widgets (like MFC) each dialog needs to be adjusted for each language, otherwise parts of labels get cut off. With Qt they resize themselves. Of course, there are cases when it does not work exactly right but it still makes everything much easier.
QString does everything in Unicode and handles the conversions from different codecs very easily.
One thing that has been very valuable is the access to the source, although e this is certainly not unique to Qt. On several occasions the ability to check the Qt source has explained some strange behaviour or given a clue how to achieve something.
We have found a few bugs in Qt, some of which have been fixed after reporting to Trolltech. In other cases they have suggested a work around. These have all been fairly obscure and not had a major impact on our development.
One of the main downsides to Qt would be the lack of 3rd party libraries for use in commercial applications. However, Qt is fairly complete so for us it has not been a big problem, though that will depend on which type of application you are developing.
I have not used Jambi either.
I've used Qt on a couple of projects I did in c++ on several platforms over a period of seven years. I think it works pretty well and definitely was quicker for me to develop a decent GUI app on the Mac than plodding through a language I didn't know (Objective-C) at the time.
I think the signal/slot mechanism is a bit funky but isn't horrible. Once you're use it for a bit, it's not a show stopper. The connection stuff is easy to bungle up (or at least it was) and it's always good to check the return on those because your app will go merrily on its way and not tell you that it didn't work.
I've never used jambi.
Here are some of my Pros and Cons with Qt:
Pros:
Cross-platform
I know this one is always used, but after going back and forth between Windows and Linux with Qt, it's amazing how little I have to do to get up and running. I think this is helped by the fact I only use Vim with Qt Designer.
QMake
This is one of my favorite aspects of Qt. After doing work in wxWidgets, FLTK, etc., I get so tired of messing around with different build systems and I don't want to manually create my makefiles. I currently use CMake on anything other than Qt right now, but I think I'm slowly moving even Qt over to CMake. However it's just so easy to get going with QMake.
QTestLib
I looked at a couple other C++ unit testing frameworks and when I created my tests using QTestLib, it felt very similar to NUnit(C#) and within minutes I had several passing tests. I also noticed that it would be very easy to create my own continuous integration environment.
Closest to Java and .Net in productivity
The biggest thing I hear/read people say about C++ is, "I can be more productive with Java or .Net". From personal experience I can get a prototype of an application running in Qt using Vim and Qt Designer, before Eclipse or Visual Studio even load. I also get a very similar set of libraries in Qt that I have in .Net or Java and if it's not there I can leverage the existing C++ code out there.
Cons:
Price
This is the biggest factor I can think of right now. However, the cost is worth every cent, um if I knew how many cents I had to save up without making a call to a sales rep. I purchased a license back in the day when they had their small business discount and it was worth it then, I would've paid three times as much and I think that's the current price.
Develop anywhere with commercial license
I would love to be able to develop on any platform, but build and sell for another platform. For example, develop on Linux, then build and deploy on Windows if you just have the Windows commercial license. From what I know, you can only develop and build a commercial application on the platform you have a license for.
Vendor lock-in
Well sort of, this is more of a personal con. I don't like being tied to a specific vendor because I get side tracked by the company direction and product direction. TrollTech was purchased by Nokia, is this good or bad I don't know, but a company that size can do evil things.
I think I'm done for now :). Oh, I haven't used Jambi but I'm really interested in doing a couple prototype projects to find out how easy it is to use a plugin developed in C++ with Jambi. Especially using Jambi as a web interface with C++ plugins.
To be honest I haven't read much on it, so it may be impossible or very easy.
I used Qt in a previous job. I'd only had the absolute briefest of contact with Qt several years prior to that, so I was pretty much a Qt newb.
When I started I was told to choose my language and environment, but cross-platform support was desirable. I tried Qt and Java, and even gave C# a go just for the heck of it. I gave myself two days to evaluate each option.
Maybe I was slightly biased with my history as a C++ developer, but after spending time on each option Qt was the only one that showed any hints at being useful without a long learning curve.
The documentation provided with Qt and the example applications made it very easy for an experienced developer but Qt beginner to get up and running very quickly. I had UI prototype/mockups of the end application done by the end of my trial period. With Java/Eclipse, Java/SunStudio and C#/VS.net I had trouble getting anything nontrivial happening in that time.
Signals/slots took some getting used to, but it wasn't too bad, and I wrote some simple wrappers to assert when connections failed to stop silly typos from stopping the app. from working.
The other thing I liked is that Qt had almost everything I needed. You name it - storage, networking, GUI, threading, containers - Qt has a class to deal with it. Which IMHO is important because mixing libraries can sometimes cause problems.
Having the source code to Qt was a big plus, one for just plain interest's sake, but also it allowed me to compile Qt using the compiler and settings of my choosing, including a debug version for use during development.
I also found Trolltech's support to be fairly good. I raised a couple of bugs on Qt, one of which was fixed and released whilst I was still working on the project (only a 6 month job).
The only negative I can recall was the difficulty in debugging Qt objects (using VS) - there is a Qt plugin for VS that can examine Qt objects but I was using the free version of VS and plugins don't work for it. But that wasn't Qt's fault.
I haven't used jambi so can't comment.
On C++ your only other alternatives are MFC and wxWidgets.
QT / wxWidgets is largely a personal preference. I do think QT is a clean design with good documentation.
QT costs about one month of developer salary if you aren't using it for GPL.
I have been using Qt for over two years now.
Things I like on Qt are:
Easy GUI programming (compared to
MFC), Qt Designer
Nice container classes
Nice graphics scene framework
Excellent documentation with useful examples
Translation support
Good technical support
I can highly recommend the Qt Developer Days. If you have a chance to take part, then do it! Lots of nice and very interesting talks there.
Qt is a very nice library, but it has an expensive per-seat developer license, so it's not always useful for all projects.
Don't use it, however...
Pro:
QT has an optional 3 phase layout, where as WX only allows for 2 currently (I believe they plan to do 3 phase, just have not worked it in yet).
One of the bigger problems with using layouts is static text and wrapping. WX asks how big is your min width/height and portions out the screen, QT has option to say how wide do you want, how high do you need to be if your X wide. This allows you to express the flow of a page much better.