- This topic has 1 reply, 2 voices, and was last updated 5 years, 9 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Programming with SOFA › get signal when Scene file is closed and display a graph (QtableWidget)
Tagged: 64_bits, Qt, scene file, SOFA, SOFA_1706, Windows_10
Hello, may be my 1st question regarding stop animation is not very much clear so I have changed that question to this: I have some code to be displayed (QTTableWidget graph) once the scene file is closed, is there anyway that when the user closes scene file (or in other words animation is end) i show that graph?
Thanks in advance
Hi @rubab123,
Are you displaying the graph using PyQt I think the closest you can do is to use the cleanup method of PythonScriptController as in the following example:
import Sofa
class MyController(Sofa.PythonScriptController):
def __init__(self, node):
pass
def cleanup(self):
print("This is called on cleanup...so do what you want")
def createScene(root):
MyController(root)
If you are working in c++ you can override the same BaseObject::cleanup method in your component.
In case you want more in-depth interaction with runSofa I think there is in RealGUI.cpp some QT signal to connect to be notified when file is changed.
Hope this helps,
Regards,
Damien.
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.