Search code examples
c++pythonqtwxwidgets

GUI developement using Python and tkinter vs Qt and C++


I am trying to make a decision for what to use to continue developing my application. I have some experience with C++ in the MFC Document/View architecture and have found it very frustrating. I felt I was always fighting the framework and also felt that my application didn't fit the doc/view architecture. (I now know that it probably would have fit, if I had known how to structure it that way.)

So I decided to try Python and ended up using tkinter. That was easier to learn and didn't have as many frustrations. (Though it had a few different new ones.) I think I learned a bit more about object orientation and setting up classes along the way. But am now concerned about the fact that it is an interpreted language and much slower than C++ for my purpose.

So I have been wanting to go back to C++ but not MFC. I have read a little about wxWidgets and Qt.

So here are the things I want to know:

  1. For wxWidgets and Qt, do they use a resource editor for setting up the layout of a GUI or directly expose the code the way Python and tkinter do.

  2. Do either wxWidgets or Qt produce any interpreted code or is everything ultimately compiled into native machine code?

Thanks


Solution

  • 1. Both
    

    Qt and wxWidgets have GUI builders available. In the case of Qt, an XML file is produced that is parsed by the uic to produce C++ code. wxWidgets has several designers available, they will differ between them, but I'll be surprised if they don't all follow the same pattern.

    However many people, myself included, choose to hand code - there is no requirement to use the UI designers. Be careful using the term 'resource editor', as Qt has a Resource Editor and it is not used for designing GUIs.

    2.  Both
    

    Qt and wxWidgets are not just GUI frameworks - they're cross-platform toolkits. In view of this, Qt is pushing for a clear separation between GUI and backend by using QtQuick and the QML language for GUI development. Qt5 still has full support for C++ widget-based development of course. wxWidgets has no equivalent that I'm aware of.

    Also, if you liked Python but not tkinter, both Qt and wxWidgets have Python bindings.