How do I make custom widgets/promote widgets for Qt designer using Pyside
-
wrote on 2 May 2021, 17:47 last edited by
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.
-
Lifetime Qt Championwrote on 2 May 2021, 17:54 last edited by mrjj 5 Feb 2021, 17:54
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/
-
wrote on 2 May 2021, 19:46 last edited by Declan Fodor 5 Feb 2021, 19:49
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.
-
3/3