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

Phil Thompson phil at riverbankcomputing.com
Wed May 23 09:19:17 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

Have you got a simpler self contained example that demonstrates the problem?

Phil


More information about the PyQt mailing list