[PyQt] why use the non-gui Qt classes in Python

Florian Bruhin me at the-compiler.org
Fri Aug 17 17:04:43 BST 2018


On Fri, Aug 17, 2018 at 11:59:17AM -0400, Christopher Probst wrote:
> Beyond signals and slots, is there any advantage in using the non-GUI Qt
> classes in a PyQt application. Why would I use QSQLDatabase, the network
> module if Python offers it already?

There are sometimes reasons - some examples:

- In general, things being async, i.e. not blocking your GUI (QProcess,
  networking, QSerial vs. PySerial, etc.)
- QSqlDatabase because you want to show it in a QTableView
- Better integration with Qt in general (e.g. QThread)
- Some functionality which is just nicer in Qt (QUrl vs. a urllib.parse
  tuple)
- Some functionality which doesn't exist in Python

Often, the main drawback is the more complex error handling, as you get
manual error checks instead of exceptions.

Florian

-- 
https://www.qutebrowser.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
         I love long mails! | https://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20180817/77006bd1/attachment.sig>


More information about the PyQt mailing list