[PyQt] Adding properties to a custom widget

Hans-Peter Jansen hpj at urpla.net
Mon Sep 10 18:55:29 BST 2007


Am Montag, 10. September 2007 18:34 schrieb skawaii:
>
> Yeah, I know about pyqtProperty(), as was indicated in my first post. But
> like you said, that's PyQt4. Oh well. Guess I'm out of luck and will have
> to come up with some crazy work-around.

..which boils down to implementing your widget in C++, as outlined in 
diverse Qt/Designer 3 docs, add python wrapper with sip, shake well, and be 
done..

I had similar problems with the Qt3 database layer, which uses properties to 
access widget values in sql forms. I got around them by reimplementing 
QSqlForm and QSqlPropertyMap in pure python, which was quite straight 
forward. Sure, that's not an option in your case..

Good luck,
  Pete


More information about the PyQt mailing list