55

The question has been asked before, but the most recent one seems to be from two years ago, so there must be new developments that must have occurred in the two toolkits.

So which toolkit should I use for developing a GUI with C++? What are the pros/cons of each?

rasen58
  • 4,672
  • 8
  • 39
  • 74
  • **Real qustion should be "`Qt` vs `Qt` + `wxWidgets`"**, because even `wxWidgets` uses `Qt` for it's GUI (see so-called `wxQt`). **Answer:** "Don't mix use of boost or Qt or wxWidgets or god knows what else!! - Qt replaces them all, while the others use Qt for GUI." – Top-Master Mar 24 '23 at 10:38
  • See also up-vote differences at: https://stackshare.io/stackups/qt-vs-wxwidgets – Top-Master Mar 24 '23 at 10:51

2 Answers2

72

In my obviously biased opinion, the advantages of wxWidgets are:

  • Native widgets (as far as possible) guarantee native look and feel
  • Standard C++ only, no special preprocessor/extensions
  • Possible to link statically to closed source applications without buying a commercial licence

Also, whether it's an advantage or a disadvantage is up to you to decide, but wxWidgets is primarily a GUI library and seeks to play well with the other specialized libraries (like SOCI or asio, for database and network support, respectively) instead of trying to be the one and only true library for everything.

mikerobi
  • 20,527
  • 5
  • 46
  • 42
VZ.
  • 21,740
  • 3
  • 39
  • 42
  • Under the LGPL license, Qt also makes it possible to link statically without buying a commercial license. Unlike wxWidgets' license, however, the LGPL requires that at least the object files (if not the source files) of the potentially/presumably proprietary code be provided to the end user, along with the library source code (in this case, Qt source code). – nairware Nov 27 '13 at 02:42
  • 4
    I think is otherwise: wxWidgets license: http://docs.wxwidgets.org/3.0/page_copyright_wxlicense.html, QT License: http://www.qt.io/licensing-comparison/ – user3658739 Jul 17 '16 at 00:30
  • 1
    Yes, I hadn't noticed @nairware's comment, but it's absolutely wrong concerning wxWidgets, the exception in wxWidgets licence expressly allows static linking. In theory LGPL allows it too if you provide the object files for relinking, but I've never seen anybody bothering to do it in practice. – VZ. Jul 17 '16 at 13:38
  • 3
    @nairware "*Qt also makes it possible to link statically without buying a commercial license*." You need to provide all the object files if you link Qt statically, according to LGPL, right? Which means nobody would do that. – Franklin Yu May 22 '18 at 15:01
  • Another Qt issue is their jumping from one license to another; suddenly since Qt 5.7, they no longer allow LGPL-2.1, which means protecting binary with hardware (Tivoization) is no longer possible with Qt. – Top-Master Dec 18 '22 at 20:14
30

If you are comparing wxWidgets with Qt, wxWidgets literally stands no where. Qt is a complete framework where you can write code and generate GUI for Linux, Windows, MAC, Android, IOS and even blackberry, and other embedded systems. It has classes for almost anything you wish to do, from controlling your webcam to bluetooth devices etc. Unless you are doing something very specific, you won't need any 3rd party library.

On the other hand, wxWidgets, essentially offers a way of creating GUI, with many other classes too but they are quite few in comparison to Qt.

Native-looking GUI vs Native GUI

Just like old and/or deprecated Java API's use; wxWidgets API's use of the operating-system's native GUI-components is actually really bad.

For example:

  • In Microsoft Windows operating-system, every single GUI-component and/or child-view, like a button, has it's own separate real sub-window.

    Where "real" means the child-view being managed by operating-system to some extent, and the child-view having own separate handle (i.e. hWnd).

  • But Qt and "new Java API" both create such real window only for root-view.

    Where "root-view" means the Window with 3 buttons at it's top (i.e. the minimize, maximize and close buttons).

  • That's possible because in Java and Qt, all child-views are virtual, meaning they are positioned and managed by framework's layout-engine and render-engine, with native-looking Theme, instead of relying on operating-system for Theme.

The efforts Java and Qt put into layout-engine and render-engine ensures that custom child-views look exactly the same across all operating-systems, and never get affected by operating-system's inconsistency.

In other words, wxWidget users need to manually test GUI for each platform, on each change, unless they use wxQt !?

Qt use cases

Many advanced softwares use Qt's GUI, and you can see dynamic-linked-libraries of Qt in:

  • Adobe Photoshop (in newer versions only)
  • Adobe Illustrator (~)
  • 3D-Max (~)
  • Maya (~)
Top-Master
  • 7,611
  • 5
  • 39
  • 71
adnan kamili
  • 8,967
  • 7
  • 65
  • 125