[PyQt] Qt v5.9.2 Support

Florian Bruhin me at the-compiler.org
Sun Oct 15 22:12:04 BST 2017


On Sun, Oct 15, 2017 at 01:22:09PM +0000, Phil Thompson wrote:
> On 15/10/2017 18:31, Florian Bruhin wrote:
> > On Sun, Oct 15, 2017 at 10:20:15AM +0000, Phil Thompson wrote:
> > > > > There are some changes in the conversions of enums which means that
> > > > > invalid values can now raise an exception. If you are using correct
> > > > > values then you shouldn't see any difference.
> > > >
> > > > I'm not sure I follow - can you show an example of a line which didn't
> > > > raise an exception before but does now?  Something like Qt.Alignment(1337)?
> > > > Or passing a value which isn't in that enum to a method taking an enum?
> > > 
> > > Yes, both of those.
> > 
> > What about things like Qt::ItemDataRole which has a range (starting with
> > Qt::UserRole) for custom values? If I'm reading this right, something
> > like
> > calling .data(Qt.UserRole + 1) on a QStandardItemModel would break, but
> > really
> > shouldn't.
> 
> I’ll have to check.

I built it now, and it seems to work like previously for me, even with values
which are definitely invalid:

    >>> from PyQt5.QtWidgets import QApplication, QLabel
    >>> from PyQt5.QtGui import QStandardItem
    >>> from PyQt5.QtCore import PYQT_VERSION_STR, Qt
    >>> PYQT_VERSION_STR
    '5.9.1.dev1710071532'
    >>> item = QStandardItem()
    >>> item.setData(42, Qt.UserRole + 1337)
    >>> Qt.ItemDataRole(1337)
    1337
    >>> Qt.Alignment(1337)
    <PyQt5.QtCore.Alignment object at 0x7ff11ce83eb8>
    >>> app = QApplication([])
    >>> label = QLabel()
    >>> label.setAlignment(Qt.Alignment(1337))
    >>>

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/20171015/3494c2b7/attachment.sig>


More information about the PyQt mailing list