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
I have QML files File1.qml, File2.qml and PythonStuff.qml.
In PythonStuff.qml I declare
Python{
id: python
//functions, handlers, etc
}
I can call functions in FileN.qml by adding
PythonStuff{
id: pythonStuff
}
to them and everything works perfectly.
But I need to create objects dynamically and call functions from PythonStuff.qml from them.
I create objects using CreateObject.js
var createdPages = [];
function createPageObjects(jid){
var component;
var page;
component = Qt.createComponent("DynPage.qml");
page = component.createObject("dynPage", {"header": header});
if(page == null){
console.log("Error creating DynPage object");
}
return page
}�
I also have
PythonStuff{
id: pythonStuff
}
in DynPage.qml to be able to call functions from PythonStuff.qml
It works, but when I call any function from any of FileN.qml or dynamically created objects, functions in my python script executes (1+number of created objects) times!
If I have
function disconnect(){
console.log("disconnect()")
call("pythonsript.con.disconnect", [], function(){})
}�
in pythonscript.py
I have "disconnected()" message printed once and "disconnected" printed (1+number of created objects) time.
Is it some kind of flaw in pyotherside or I just do it incorrectly?
The text was updated successfully, but these errors were encountered:
I have QML files File1.qml, File2.qml and PythonStuff.qml.
In PythonStuff.qml I declare
I can call functions in FileN.qml by adding
to them and everything works perfectly.
But I need to create objects dynamically and call functions from PythonStuff.qml from them.
I create objects using CreateObject.js
I also have
in DynPage.qml to be able to call functions from PythonStuff.qml
It works, but when I call any function from any of FileN.qml or dynamically created objects, functions in my python script executes (1+number of created objects) times!
If I have
in PythonStuff.qml
and
in pythonscript.py
I have "disconnected()" message printed once and "disconnected" printed (1+number of created objects) time.
Is it some kind of flaw in pyotherside or I just do it incorrectly?
The text was updated successfully, but these errors were encountered: