You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all thanks for the excellent Qt4 bindings! 😄
I'm the author of the pytest-qt plugin for pytest, and I'm currently working on creating a Python version of ModelTest.
I'm having some trouble testing a QStringListModel instance because it doesn't seem to provide all the public methods it should as a QAbstractListModel subclass. For example, the docs for QAbstractListModel explicitly say:
The columnCount() function is implemented for interoperability with all kinds of views, but by default informs views that the model contains only one column.
TypeError: columnCount(const QModelIndex & parent) const is a private method.
I see the same issue with parent() and hasChildren() methods.
The same snippet works fine for PyQt4 and PyQt5.
Is this a known issue? Is there any workaround?
Cheers,
🍻
The text was updated successfully, but these errors were encountered:
nicoddemus
changed the title
QStringListModel methods inherited from QAbstractListModel private
QStringListModel methods inherited from QAbstractListModel said to be private
Sep 8, 2015
Did you actually test this with PyQt4/PyQt5 or just assumed it worked because of my model tester code (which uses sip.cast to circumvent this)? Your snippet fails for me with TypeError: QAbstractListModel.columnCount() is a private method with PyQt4/PyQt5 as well. 😉
Also, those methods definitely are private in Qt, so I don't think PySide is to blame here - except for not having a sip.cast equivalent 😉
Sorry, you are correct, the snippet does fail in PyQt4 and 5 as well... I got mislead by the documentation, but indeed the C++ header explicitly mark those functions as private. :frown:
I agree this is not a bug but is there any workaround for that problem in Pride?
Hi there!
First of all thanks for the excellent Qt4 bindings! 😄
I'm the author of the pytest-qt plugin for pytest, and I'm currently working on creating a Python version of ModelTest.
I'm having some trouble testing a
QStringListModel
instance because it doesn't seem to provide all the public methods it should as aQAbstractListModel
subclass. For example, the docs forQAbstractListModel
explicitly say:But the snippet below:
Fails with this error:
I see the same issue with
parent()
andhasChildren()
methods.The same snippet works fine for
PyQt4
andPyQt5
.Is this a known issue? Is there any workaround?
Cheers,
🍻
The text was updated successfully, but these errors were encountered: