Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Absolute beginner

Absolute beginner

Scheduled Pinned Locked Moved Solved Qt for Python
5 Posts 4 Posters 2.5k Views
  • 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.
  • W Offline
    W Offline
    walkjivefly
    wrote on 4 Nov 2019, 07:51 last edited by walkjivefly 11 Apr 2019, 07:53
    #1

    I have forked an open-source project written in Python which uses Qt 5 to provide the GUI goodness. I want to make some changes to the GUI stuff (move some of the main dialog into a tab, clone the tab, make some changes in the clone, have the clone run new bits of code).

    I could just edit the main_dialog.ui file and bodge my way through duplicating chunks of XML, adding some widgety bits, renaming stuff, and keep my fingers crossed when running pyuic. But this is 2019, not 1985 so there must be a better, easier way.

    I guess it would be to use QT Designer. But I can't find a way to install it. Remember: absolute beginner here. DDG finds several quick tutorials along the lines of

    setup a Python 3.6 venv
    pip install pyqt5
    pip install pyqt5-tools
     (or possibly)
    pip install pyqt5designer
    

    Pip is happy to install pyqt5 but doesn't want to know about pyqt5-tools or pyqt5-designer:

    (venv) mark@avm:~/tmp/pyqtest$ pip install pyqt5-tools
    ERROR: Could not find a version that satisfies the requirement pyqt5-tools (from versions: none)
    ERROR: No matching distribution found for pyqt5-tools
    (venv) mark@avm:~/tmp/pyqtest$ pip install pyqt5-designer
    ERROR: Could not find a version that satisfies the requirement pyqt5-designer (from versions: none)
    ERROR: No matching distribution found for pyqt5-designer
    

    So can someone please explain what I need to do to go from a clean ubuntu18 install to being able to run some GUI design tool and convert the resulting .ui file into a .py which will play nicely with the rest of my project?

    Thanks in advance.

    J 1 Reply Last reply 4 Nov 2019, 08:17
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 4 Nov 2019, 07:55 last edited by
      #2

      Hi and welcome to devnet,

      The most simple and straightforward way would be to install the Qt 5 tools from your distribution. Use apt and install the qttools5-dev-tools package.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3
      • W walkjivefly
        4 Nov 2019, 07:51

        I have forked an open-source project written in Python which uses Qt 5 to provide the GUI goodness. I want to make some changes to the GUI stuff (move some of the main dialog into a tab, clone the tab, make some changes in the clone, have the clone run new bits of code).

        I could just edit the main_dialog.ui file and bodge my way through duplicating chunks of XML, adding some widgety bits, renaming stuff, and keep my fingers crossed when running pyuic. But this is 2019, not 1985 so there must be a better, easier way.

        I guess it would be to use QT Designer. But I can't find a way to install it. Remember: absolute beginner here. DDG finds several quick tutorials along the lines of

        setup a Python 3.6 venv
        pip install pyqt5
        pip install pyqt5-tools
         (or possibly)
        pip install pyqt5designer
        

        Pip is happy to install pyqt5 but doesn't want to know about pyqt5-tools or pyqt5-designer:

        (venv) mark@avm:~/tmp/pyqtest$ pip install pyqt5-tools
        ERROR: Could not find a version that satisfies the requirement pyqt5-tools (from versions: none)
        ERROR: No matching distribution found for pyqt5-tools
        (venv) mark@avm:~/tmp/pyqtest$ pip install pyqt5-designer
        ERROR: Could not find a version that satisfies the requirement pyqt5-designer (from versions: none)
        ERROR: No matching distribution found for pyqt5-designer
        

        So can someone please explain what I need to do to go from a clean ubuntu18 install to being able to run some GUI design tool and convert the resulting .ui file into a .py which will play nicely with the rest of my project?

        Thanks in advance.

        J Offline
        J Offline
        JonB
        wrote on 4 Nov 2019, 08:17 last edited by JonB 11 Apr 2019, 08:34
        #3

        @walkjivefly said in Absolute beginner:

        pip install pyqt5-tools

        Have a read through https://stackoverflow.com/questions/42090739/pyqt5-how-to-start-the-designer, especially the accepted solution which is most up-to-date. Looks like it's problematic from PyQt 5.7+? You may be best following @SGaist's advice to do it via apt install, outside of your virtual environment?

        Otherwise sign up to the PyQt mailing list via https://riverbankcomputing.com/mailman/listinfo/pyqt and ask there. They will tell you the definitive on all things PyQt.

        1 Reply Last reply
        1
        • W Offline
          W Offline
          walkjivefly
          wrote on 4 Nov 2019, 18:20 last edited by
          #4

          Thank you both for the replies. The PyPi approach doesn't work but @SGaist suggestion was spot on!

          Designer ran, changes made, pyuic5 generated a .py from the updated .ui and I'm onto the next stage. Thanks again.

          1 Reply Last reply
          1
          • S Offline
            S Offline
            Soth20
            wrote on 19 Oct 2020, 20:54 last edited by
            #5

            I have the same problem in Windows 10. I cannot install pyqt5-tools or designer. I run Python 3.9 and Pip 20.2.4. I get the same error in cmd. What should I do? thanks.

            1 Reply Last reply
            0

            • Login

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