[PyQt] Creating custom widget for designer

Jorge Tornero jtorlistas at gmail.com
Thu Aug 21 03:59:10 BST 2014


Dear all,
I've created a  custom widget which can be used from within designer-qt4,
following the few recipes available out there.

It works as expected but, because I'm not a pro, I'm looking for some
advice on the way I've implemented the widget.

Basically: the base class is a QLineEdit in which a key event triggers a
Qdialog which has customized QComboBox inside. Therefore I've implemented
the widget as a single  class in this fashion (simplified)

class myLineEdit(QLineEdit):
   class myPopupDialog(QDialog):

        class myCustomCombo(QComboBox):
               (Definition of myCustomCombo goes here)
       (Definition of mypopupdialog goes here, including some customcombos)

    (Defi ition of mylineedit goes here including key event handler
that execs a mypopupdialog)

This, say so, class-!nesting schema is very strange to me, so let me
ask you if this is a correct way of implementing such widgets,
providing they're going to be used as designer plugins.

Thank you very much for your advice


All the best

Jorge Tornero

           (Blah, blah)


More information about the PyQt mailing list