Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Why Qt desperately is targeting python ?



  • Since the primary goal for Qt is to provide C++ programmers with tools for building realistic GUI and it indeed has succeeded. I've found weird that Qt community is targeting python programming. It seems to me it is a desperate move to target more audience. Am I right? Any reasons for this move? Why they are eager for python?


  • Moderators

    @CroCo, if you publish a toolkit, you would want your project to be used by as many people as possible, right? I don't think it's desperation; it's common sense. A wider audience makes your toolkit stronger.

    Let's look at it the other way: Why shouldn't the Qt Project target Python? Why should it restrict itself to C++ programmers only? Lots of non-C++ programmers want to use Qt: https://wiki.qt.io/Language_Bindings#These_are_third_party_language_bindings_for_Qt

    the primary goal for Qt is to provide C++ programmers with tools for building realistic GUI

    That is how Qt started, but Qt is more than just a GUI toolkit today -- it is a multi-purpose toolkit for cross-platform development, covering lots of useful non-GUI use-cases (like networking, cryptography, SQL, data serialization, and more: https://doc.qt.io/qt-5/qtmodules.html).

    And it's not just a C++ toolkit anymore; QML is a huge part of Qt now.

    Any reasons for this move? Why they are eager for python?

    Python has one of most active communities today. So, it makes sense to make Qt easily accessible to Python programmers.


  • Qt Champions 2019

    @croco I was using Qt and PyQt in 200x already, this is really nothing new and I have no idea why you think it could be desperation.
    "Why they are eager for python?" - why not? If it is possible why shouldn't Python be supported? There are people using Python and Qt, there is nothing wrong about it.



  • For downvoters, please be open-minded. I'm not attacking Qt rather I need to know why this massive move is needed.



  • @jksh well if we are going with this logic, then we may see in the future a move for other programming languages like Java. If we proceed, then C++ programming will be at risk. But I still didn't convinced why pyhton rather than other programming languages such as Java, C# or even Matlab if the goal is to target academic audience. I'm not here to attack python rather I would like to see more convincing reasons for this adaptation.


  • Lifetime Qt Champion

    Hi,

    Java bindings were already done a long time ago. It was called Qt Jambi.

    As for the Python move, there's no move, the bindings have existed for years. The main difference now is that you have a new set of bindings that follow the same licensing model as Qt itself which makes them easier to integrate in other projects.

    Python is one of the main language in the research and academic fields. Take for example Pytorch and Tensorflow in the deep learning and artificial intelligence area.

    There are other bindings that exists for other languages that are less known.

    As for C/C++, it's not going away anytime soon. It's still the language that allows you to squeeze all the power you can from your hardware.

    [edit: fixed typo SGaist]


  • Lifetime Qt Champion

    Hi @croco,

    I've just to add to @SGaist: Qt is written in C++ and that did not change even if QML existed for a decade. And you still can program in pure C++ without ever needing to know QML.

    And that is what happens with lots of libraries: the core is written in a machine near language, but the API is exposed to anything possible. Just use the language that fit's your project best.

    Regards


  • Moderators

    @croco said in Why Qt desperately is targeting python ?:

    @jksh well if we are going with this logic, then we may see in the future a move for other programming languages like Java.

    Yes, that's right. If Java becomes rapidly-growing, then it makes sense to consider targeting Java programmers too. In the practice of project management, this is called adaptation.

    Nokia used to be one of the most successful phone makers in the world. However, it failed to adapt to new market conditions, so Nokia collapsed.

    If Qt can adapt to the changing programming world, then Qt will continue to succeed.

    If we proceed, then C++ programming will be at risk.

    Can you explain why you think that supporting new languages puts C++ at risk?

    The Qt Project is not dropping C++ in favour of Python; it is adding Python to its core C++ ecosystem.

    But I still didn't convinced why pyhton rather than other programming languages such as Java, C# or even Matlab if the goal is to target academic audience. I'm not here to attack python rather I would like to see more convincing reasons for this adaptation.

    Then let data convince you. See the Stack Overflow Developer Surveys:

    The table below summarizes what percentage of survey respondents used the languages that you mentioned:

    Language 2017 2018 2019
    Python 32.0% 38.8% 41.7%
    Java 39.7% 45.3% 41.1%
    C# 34.1% 34.4% 31.0%
    C++ 22.3% 25.4% 23.5%
    Matlab 4.3% 5.8% N/A

    As you can see, Python is the only one in the list to grow by almost 10% over the last 2 years. Back in 2017, Python was less commonly-used than Java or C#, but this year it has overtaken both Java and C#. Python is also expected to grow even more next year.

    The Matlab community is too small, so it doesn't make sense for the Qt Project to spend too much effort targeting Matlab users.


  • Moderators

    @jksh I'm curious, do you think the high Java part is mostly due to Android and it's multitude of platforms ?


  • Moderators

    @j-hilk said in Why Qt desperately is targeting python ?:

    @jksh I'm curious, do you think the high Java part is mostly due to Android and it's multitude of platforms ?

    Hmm... quite possibly.

    According to https://insights.stackoverflow.com/survey/2019/#technology-_-platforms 27.0% of respondants developed software for Android (c.f. 53.3% for Linux and 50.7% for Windows)

    So if we assume that 75% of Android developers use Java, that leaves 21.5% (= 41.7% - 0.75*27.0%) of respondents who do purely non-Android development using Java.



  • @croco said in Why Qt desperately is targeting python ?:

    Since the primary goal for Qt is to provide C++ programmers with tools for building realistic GUI

    What makes you say that Qt's "primary goal" is to support C++? Yes, it's written in C++, but no reason why not to support other user programming languages, provided bindings can be made available.

    I am forced to use Qt from Python, and whatever the shortcomings of that language there is no reason why C++ should be suitable for "building realistic GUI" but not Python.



  • I would say that due to python being a default install in many *nix based platforms is one reason. If Qt is available then it is pretty simple to put together dialogs and scripts for doing common tasks. Python is the glue language. The major alternative for guis in Python wxpython. I have used both and Qt is a much richer system for guis.


Log in to reply