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

Christopher Probst christop.probst at gmail.com
Fri Aug 17 17:12:28 BST 2018


Thank-you Florian. I very much appreciate this feedback.

On Fri, 17 Aug 2018 at 12:04, Florian Bruhin <me at the-compiler.org> wrote:

> 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 --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20180817/09f47262/attachment.html>


More information about the PyQt mailing list