[PySide] When Slots and When Subclass?
Florian Bruhin
me at the-compiler.org
Fri Mar 18 22:54:39 CET 2016
* Tim Roberts <timr at probo.com> [2016-03-18 14:47:20 -0700]:
> Is there some document that can help me understand what's likely to be
> signalled and what requires subclassing? Some general rule you use in
> practice?
In general, things you'd control via subclassing are much more
low-level (like Qt's whole event system), and signals are much more
high-level.
For example, with a QLineEdit, you could override keyPressEvent to get
low-level keypresses - or use the returnPressed signal, which works
with enter/return, and only emits when the input is valid if a
validator is set.
But there are certainly some exceptions (usually things which require
subclassing which IMHO would be much nicer as a signal).
Florian
--
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20160318/e261b91f/attachment.sig>
More information about the PySide
mailing list