Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. Can we use python in qt?
Forum Updated to NodeBB v4.3 + New Features

Can we use python in qt?

Scheduled Pinned Locked Moved Solved Language Bindings
6 Posts 4 Posters 2.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Niconi
    wrote on last edited by
    #1

    Can we use python in qt? from what I know qt using c++, but i heard about pyQT or something like that, but i don't know what is that, different version of qt?

    I want use python in qt, what should i do, what I must to download?
    Thanks :)

    JonBJ 1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by A Former User
      #2

      Hi! Qt is a set of libraries written in C++. It's easy to use these libraries in an application when that application is written in C++, too. Applications written in Python can not directly use C++ libraries. Thus you can not use the Qt libraries directly in a Python application. But it's possible to write code that extends the Python run-time with custom modules. These extensions can use C++ libraries internally. PyQt is a set of Python modules that act as Python wrappers of the Qt C++ libraries. This is called a language binding. PyQt is not part of the Qt Project, but a separate product by Riverbank. For more info on PyQt see their website.

      1 Reply Last reply
      3
      • N Niconi

        Can we use python in qt? from what I know qt using c++, but i heard about pyQT or something like that, but i don't know what is that, different version of qt?

        I want use python in qt, what should i do, what I must to download?
        Thanks :)

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @Niconi
        Further to @Wieland, and just so you know, I use PyQt from Python and it's fine and comprehensive. You will get 99.9% of the Qt C++ functions/types etc. available to you.

        The only thing you have to bear in mind is most examples & help for Qt will show C++, you have to be prepared to do a little logical thinking when adapting to PyQt at times.

        Also, if you are going to develop in Python (including with Qt & PyQt) I strongly recommend you use PyCharm (https://www.jetbrains.com/pycharm/) as your IDE.

        1 Reply Last reply
        0
        • tekojoT Offline
          tekojoT Offline
          tekojo
          wrote on last edited by
          #4

          Hi! There is also the PySide 2 project https://wiki.qt.io/PySide2
          It is about bringing the old PySide project that worked with Qt4 up to date to Qt5.
          It's not completely ready, but worth following, as it is part of the Qt project.

          JonBJ 1 Reply Last reply
          0
          • tekojoT tekojo

            Hi! There is also the PySide 2 project https://wiki.qt.io/PySide2
            It is about bringing the old PySide project that worked with Qt4 up to date to Qt5.
            It's not completely ready, but worth following, as it is part of the Qt project.

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by JonB
            #5

            @tekojo
            One has to make a firm decision as to whether to go down the PyQt or the PySide(2) route, once and for all.

            I would have welcomed using the solution which is part of the Qt project. However, it is consistently so woefully behind PyQt and the current version of Qt (in that it has many classes etc. missing) that I cannot see why anyone would want to muddy the waters by suggesting it as an alternative?

            [EDIT: Oh maybe if you have to use LGPL, that's all I can think of? But then be careful as many parts of Qt are not interfaced. What I don't understand is that it's supposed to properly "supported" by Qt (as per the link, right?), but it clearly is not decently maintained, so why bother?]

            tekojoT 1 Reply Last reply
            0
            • JonBJ JonB

              @tekojo
              One has to make a firm decision as to whether to go down the PyQt or the PySide(2) route, once and for all.

              I would have welcomed using the solution which is part of the Qt project. However, it is consistently so woefully behind PyQt and the current version of Qt (in that it has many classes etc. missing) that I cannot see why anyone would want to muddy the waters by suggesting it as an alternative?

              [EDIT: Oh maybe if you have to use LGPL, that's all I can think of? But then be careful as many parts of Qt are not interfaced. What I don't understand is that it's supposed to properly "supported" by Qt (as per the link, right?), but it clearly is not decently maintained, so why bother?]

              tekojoT Offline
              tekojoT Offline
              tekojo
              wrote on last edited by
              #6

              @JNBarchan it's being worked on. Getting something like that back up to date takes time. It was left behind for a long time.
              I mentioned it, as it will at some point be an option.

              1 Reply Last reply
              2

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved