[PyQt] QML with a event on delegate - possible bug

Phil Thompson phil at riverbankcomputing.com
Fri May 25 16:44:50 BST 2018


On 17 May 2018, at 12:58 pm, amine <amine.bachri at afpa.fr> wrote:
> 
> Hello,
> 
> I have discovered the pyQt binding (in fact also Python), and i found it
> very nice!
> 
> Everything works perfectly well, however i found a strange behavior looking
> like a bug :
> 
> In a delegate i activate a javascript after an event, something like :
>                onClicked: {
>                    idTextTest.text = "clicked ok"
>                    Context.doActionInPython("enleveDomino", index)
>                }
> This code works fine.
> 
> But the almost same code 
>                onClicked: {                  
>                    Context.doActionInPython("enleveDomino", index)
>                    idTextTest.text = "clicked ok" #show a : 
> ReferenceError: idTextTest is not defined
>                }
> doesn't find the obvious Component.
> 
> I guess this is not normal, 
> 
> i've settled a small project in :
> https://github.com/mine-bach/pyqt5_qmlListProperty

Sorry, I don't know the cause. It is the emit of the notify signal that is triggering it but all I can see is that QML is then re-reading the list (as you might expect).

Phil


More information about the PyQt mailing list