new QWebChannel(qt.webChannelTransport,
function(channel) {
{
window.my_object = channel.objects.my_object;
alert(my_object.test.myHello()); // 1
}
});
after the above code uses python to insert into the page (html introduces qwebchannel.js can not be executed correctly, I don"t understand why), the code in 1 can output
correctly.$("-sharpget-info").on("click",
function() {
alert(my_object); // 2
});
The code in 2 outputs undefined,. Excuse me, why?