[PyQt] Access Python QObject from QML fails to convert on second call
Fabian Sturm
f at rtfs.org
Thu May 19 19:05:46 BST 2016
Hello Phil!
Thanks for looking into my code. Unfortunately your suggestion did not
help me. I still see the error. I just updated the code on github with
your suggested change. Changing between different values in the
combobox for a couple of times still triggers the bug :-(
Changed source:
NameRole = Qt.UserRole + 1
_roles = {
NameRole: b"name",
}
Can you see the problem too?
Thanks a lot,
Fabian
Am Donnerstag, den 19.05.2016, 18:34 +0100 schrieb Phil Thompson:
> On 17 May 2016, at 7:08 am, Fabian Sturm <f at rtfs.org> wrote:
> >
> > Sorry for no direct reply to my previous message but I somehow
> > never
> > received it myself.
> >
> > I now reduced my code to a short sample:
> >
> > https://github.com/sturmf/python_samples
> >
> > In the folder pyqt_combobox_qabstractlistmodel is a small program
> > you
> > can start with "python3 main.py"
> >
> > Changing between the currently visible item in the ComboBox
> > produces my
> > error. Any help to get this sample fixed would be awesome!
>
> Changing "name" in _roles to b"name" meant it all seemed to work for
> me.
>
> Phil
> _______________________________________________
> PyQt mailing list PyQt at riverbankcomputing.com
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
More information about the PyQt
mailing list