Warning when calling obsolete Qt methods?

Florian Bruhin me at the-compiler.org
Fri Aug 27 12:16:53 BST 2021


Hi,

I recently used PySide2 and noticed it shows a warning when calling
obsolete methods:

    >>> from PySide2.QtGui import QFont, QFontMetrics, QGuiApplication
    >>> a = QGuiApplication()
    >>> fm = QFontMetrics(QFont())
    >>> fm.width('a')
    <stdin>:1: DeprecationWarning: QFontMetrics.width(const QString & arg__1, int len) const is deprecated
    8

PyQt5 does no such thing, and I suppose it's the same for PyQt6 so far.

While starting to port things to Qt 6, I noticed I was accidentally
using some methods which have long been deprecated already.

Would it be possible for PyQt6 to start doing the same thing when things
are getting deprecated in Qt 6?

Florian

-- 
            me at the-compiler.org | https://www.qutebrowser.org 
       https://bruhin.software/ | https://github.com/sponsors/The-Compiler/
       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/20210827/63ec956a/attachment.sig>


More information about the PyQt mailing list