Reasons that I choose wxWidgets instead of Qt as GUI framework for my hobby projects
I had been using Delphi and VCL in my daily work and hobby projects for several years.
Recent years I gave up on Delphi/BCB for whatever reason and turned to C++ development for hobby projects. Yes, for hobby, I never had chance to use C++ in my daily work.
When comes to GUI project, I need a GUI framework written in C++.
My criterias on C++ GUI framework:
- Free. This is a must. And especially it should be free to be static linked. Thus MFC is not in my list. MFC is not in VC Express version.
- Open source. So I can read the code to learn and debug. Close source library is black box to me and I don't know how it works and may totally lose control on it.
- Decent GUI visual designer tool. Decent means that at least I should be able to visually design forms (not only dialogs but also any top level windows) with most common used components. In my opinion, GUI should be designed visually. Manually coding GUI is boring and error prone. I would like to put my time and energy on coding core logic instead of UI. With this criterion, a lot of open source frameworks are kicked out from my list.
- Decent application size. A notepad application with 10M runtime DLLs is not a good idea. This may be not an issue for large project. But it's important to me because my project is usually small or medium scale, never be very large.
- Easy to install/config/build. I have the impression (maybe wrong) that open source libraries are always difficult to build. A lot of hack, a lot of hardcore changes. I don't want to be hardcore, I only want to use the code, that's all.
- Easy to integrate with any common used compilers and IDEs. My primary IDE is VC 2008 Express and I really love it. If I'm forced to use other IDE, I may lose efficiency. Also I need to use MinGW GCC to test C++ syntax. So the framework should be at least working in VC Express and GCC.
- Good quality. I'm not expecting a bug free library, I'm also not accepting too buggy library.
- Documentation. I'm not expecting a document which is as comprehensive as MSDN, but an API document is a must.
- Community support. Whenever I have a problem, I need a place to ask and get response in reasonable time.
- User base. Some non-trivial companies should have applications built on the framework to show the trustworthy of the library.
- Cross platform. This is a bonus but I would be very happy to have it.
- Unicode support. Another bonus that I'm happy to have.
With these criteria, I found only wxWidgets and Qt are considerable, since other libraries, such as GTKmm, Ultimate++, VCF, SmartWin, can hardly meet all criterias. And both wxWidgets and Qt had near 20 years development so they should be mature enough.
At first I only tried Qt, because as far as I know, wxWidgets is quite MFC like and Qt is better in high level design. I will consider Qt as VCL like and I love VCL.
But after a while I want to give up Qt because it fails in several points,
- Too hard to integrate to VC Express or Code::Blocks (an IDE with GCC compiler). I have no clue on how to compile Qt application in VC Express. It's quite easy to develop applications in Qt Creator, but I don't want to be limited to any single IDE. I would choose any IDE I like to use.
- Application size is too big. It's not acceptable for small applications.
- Too huge and bloated a library. A gigabytes library. Need several hours to build the libraries. That means whenever there is a bug fix update, you need another hours to build again. It's not a GUI framework, but an application framework, too more than I need.
- Non-standard C++ code is always not good (even if not bad). I really don't like the meta object compiler dependence. There are tons of ways to implement signal/slot and RTTI in standard C++.
After gave up on Qt, I tried wxWidgets and found I really like it in several points,
- Very very easy to build with VC Express and GCC. With VC, it only takes several minutes to build the whole library. GCC took longer, but only about half an hour.
- Application size is decent, not too small, especially in 2.9.1, the size is much bigger. But the overall application size is quite smaller than Qt.
- Concise library. It's only a GUI framework plus some other portable cross platform modules, such as thread, socket.
- Very good GUI designer (equivalence is in Qt). Indeed I tried wxFormBuilder before reading the API document. Though wxFormBuilder is far less good than Delphi designer, I would say it's already a quite good RAD tool. I can place many common used controls visually, change the layout, define the event handler, that's all I need in a RAD GUI designer tool.
- The library is being evolved in a very good direction. For example, the old wxWidgets was infamous with the MFC style event table macros, but in the newest 2.9.1, a "bind" function is introduced to use template and functor as event handler, this is very modern C++ style, and I think it is a more elegant approach to callback system than Qt MOC. Also I really like the ribbon component though I didn't test yet.
- Good community support (equivalence is in Qt). I asked some questions in the forum, got the answers in reasonable time.
Summary:
This blog explains why I choose wxWidgets instead of Qt. That's all. I didn't recommend wxWidgets over Qt, and I would not say wxWidgets is better than Qt. I only chose the proper library that meets my requirements. If you are looking for a GUI library, make the decision on your opinion because you may have different requirements.