4

PyQt has a plugin system for adding python widgets to Qt Designer so that they can be drag'n'dropped into the .ui files for other widgets.

http://pyqt.sourceforge.net/Docs/PyQt4/designer.html#writing-qt-designer-plugins

How could this be done for PySide widgets?

asked Feb 12, 2015 at 18:18
1
  • 1
    No. You can use the widget promotion mechanism, though. Commented Feb 12, 2015 at 18:56

3 Answers 3

3
+50

To answer the specific question: "How could this be done for PySide widgets?"

There was once a QtDesigner plugin for PySide that that allowed custom widget plugins to be written in python. However, development on it stopped before it became fully viable. To quote from the pyside mailing list:

On Thursday 24 March 2011 19:18:02 Hugo Parente Lima wrote:

On Wednesday 23 March 2011 22:46:32 Gerald Storer wrote:

I vote for removing the QtDesigner plugin example from pyside-examples, it doesn't work and the support for QtDesign plugins isn't on our roadmap yet, besides IMO it's not a very important feature to have and we have more urgent bugs and features to do at the moment.

Any objections?

Timeout! Plugin examples removed from pyside-examples repository.

So all you have to do is find that old QtDesigner source code, get it working, and then submit the necessary patches :-)

answered Feb 17, 2016 at 0:48

Comments

1
  1. Add your widgets' codes to the project .pro file.
  2. From Qt Designer pick up a Widget and place it on the form. enter image description here

  3. Right click on it and select Promote to...

  4. Enter name of your widget's class. enter image description here
answered Feb 16, 2016 at 20:28

Comments

0

You can just use Promote to... now on Qt Designer provided by PySide6 now. Just fill in the py file name (no .py extension) in the Header file

answered Feb 16, 2021 at 4:36

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.