Qt programming: More productive in Python or C++? Qt programming: More productive in Python or C++? python python

Qt programming: More productive in Python or C++?


If one or the other, I'd actually suggest Python in spite of being a C++ enthusiast. With Python code you don't have to bother with the MOC, portability, build times, etc. Just compare the work involved in implementing a QT slot in C++ vs. PyQT or PySide, e.g. I find it to be much less of a pain to deal with widgets this way (much greater productivity). You can still invoke C++ code from Python in cases where you need the added performance.

If you do use a combination, consider extending Python rather than embedding it. Python is generally better suited to embed C/C++ code than to be embedded into a C/C++ system. It also tends to make more sense that way as applications are generally composed of far more mundane, non-performance critical code than performance-critical code, so writing your application primarily as a python application with C/C++ functions attached to it fits that kind of system design better.


My Opinion (having tried out C++ and Python in general and specifically in Qt case): Python always wins in terms of 'programmer productivity' and 'peace of mind'. PyQt represent Qt very well and hence question doesn't remain of "Qt with Python" or "Qt with C++", in general python is more productive unless off-course you need speed or something which isn't available in python.

Best way for you to arrive at the answer would be to write a simple project first in C++ and then same project in python and compare, but that could be biased towards python as after coding the project once you may find it easy in Python, so try another project too and first do it in Python and then in C++.


definitely Python.

Yes, people will say that Python is more productive without a reason. Some of the answers mention that you do not have to recompile. I will give you some more details

  1. Python is one layer of abstraction over C++, so you can think and express your designs with less code. Your program might not run as fast, but sure you express faster in code what you want.

  2. The most common case is when you launch your application, load some files, setup the environment and open a dialog. There you notice that a button is not working or where it should be. Now that is the point where most people close the application, bind one slot here, one signal there... and start the application, load the files, setup... with python you just write the code and fire up the dialog again, not the whole application. I do not know about you, but that type of task is what I do most of the time with Qt

  3. Python gives you something that C++ does not have: introspection. You can explore a running program and pull out information about its components on runtime. Qt gives you partially this. You have that MOC layer where meta properties and meta information can be attached to Qt objects. All parts of a Python program can be introspected. Many people debugging Python code, or trying to understand how it works, are addicted to this for a good reason