[PyQt] PyQt 5: Equality operator not implemented for QStringListModel?

Arve Knudsen arve.knudsen at gmail.com
Wed Jun 25 19:45:51 BST 2014


Thanks for clarifying!Fra: Phil Thompson
Sendt: ‎25.‎06.‎2014 17:30
Til: pyqt at riverbankcomputing.com
Emne: Re: [PyQt] PyQt 5: Equality operator not implemented for
QStringListModel?
On 25/06/2014 3:57 pm, Arve Knudsen wrote:
> Hi guys
>
> Using PyQt 5.2.1, I've noticed that comparing two QStringListModels
> for equality always returns false, is there any reason for this?
> Example:
>
>     from PyQt5 import QtCore
>
>     model1 = QtCore.QStringListModel(['1', '2'])
>     model2 = QtCore.QStringListModel(['1', '2'])
>
>     print(model1 == model2) # Prints False
>     # Corresponding QStringLists can be compared OTOH
>     print(model1.stringList() == model2.stringList()) # Prints True

It's not supported by Qt.

Phil
_______________________________________________
PyQt mailing list    PyQt at riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


More information about the PyQt mailing list