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

Maurizio Berti maurizio.berti at gmail.com
Fri Aug 17 21:00:22 BST 2018


Also, some functionalities are much more complete in Qt, and there's more
consistency using a single (almost always) coherent framework than
different (external) modules, which differ by syntax, naming convention,
argument order and error handling.
Finally, a more comprehensive cross-platform support (for example regarding
path support, which always uses "/" and doesn't need complex handling with
os.path.join and os.path.sep).

Il giorno ven 17 ago 2018 alle ore 18:05 Florian Bruhin <me at the-compiler.org>
ha scritto:

> 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/
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt



-- 
È difficile avere una convinzione precisa quando si parla delle ragioni del
cuore. - "Sostiene Pereira", Antonio Tabucchi
http://www.jidesk.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20180817/75cedb92/attachment-0001.html>


More information about the PyQt mailing list