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. How do I make custom widgets/promote widgets for Qt designer using Pyside

How do I make custom widgets/promote widgets for Qt designer using Pyside

Scheduled Pinned Locked Moved Solved Qt for Python
3 Posts 2 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.
  • D Offline
    D Offline
    Declan Fodor
    wrote on 2 May 2021, 17:47 last edited by
    #1

    Hello, I'm trying to figure out how to make a custom widget work in Qt designer, however I don't exactly know c++ very well, so I was hoping I could try doing it in python. The problem is, I can't find any relevant documentation relating to making custom widgets with pyside and using them with Qt designer. For example, I want to have 2 buttons and have each set the current index of the stacked widget they are in to a different number (Button 1 sets the page to 2, while button 2 sets the page to 5), and I could do this with some sort of custom button widget.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 2 May 2021, 17:54 last edited by mrjj 5 Feb 2021, 17:54
      #2

      Hi
      Disclaimer. I have not tried it.

      However, from a quick browse in google, it seems like the same as with c++

      https://www.mfitzp.com/tutorials/embed-pyqtgraph-custom-widgets-qt-app/

      1 Reply Last reply
      2
      • D Offline
        D Offline
        Declan Fodor
        wrote on 2 May 2021, 19:46 last edited by Declan Fodor 5 Feb 2021, 19:49
        #3

        I've managed to get it to work, I needed to convert the ui file to .py for whatever reason, thank you for the help!

        Edit: For those trying to do this in the future, make sure that when you put in the python file into the header input, you don't put the .py at the end, as it literally takes that letter for letter and converts it to an import statement when you convert the ui to a py file.

        1 Reply Last reply
        1
        • J JonB referenced this topic on 20 Feb 2025, 15:03

        3/3

        2 May 2021, 19:46

        • Login

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