Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using PySide custom widgets in Qt Designer

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?

like image 359
Brendan Abel Avatar asked Sep 17 '25 16:09

Brendan Abel


2 Answers

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 :-)

like image 112
ekhumoro Avatar answered Sep 19 '25 06:09

ekhumoro


  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
like image 34
frogatto Avatar answered Sep 19 '25 04:09

frogatto