Hello,
is it possible to get a signal of any kind when we edit a name on the object browser or create a new group in python?
i am looking for something that if we change a name or create a group, for example automatically in the python console it will ‘object created’ or ‘group created’ (when we do it from the GUI i mean)
The browser (which is a TreeView), does not emit the “objectChanged” or “somethingEdited” signal. It does emit “selectionChanged” but that does not help when you change the name of the items. After checking the source code of KERNEL and GUI I’m not seeing anything useful, that is when I inspected the “Rename” function I didn’t see any signals being emitted… By the nature of the browser it does not care whether data changed because the items inside do the handling of the rendering. I might be wrong though.
thank you, and by change “object created”?
would you mind pointing me where did you saw this? on the doc? thanks!
“object created” as in a object was clicked/selected not modified.
import SalomePyQt
sPyQt = SalomePyQt.SalomePyQt()
browser = sPyQt.getObjectBrowser()
browser.selectionChanged.connect(<your PyQt Slot function>)
I used this when I created dialog for selecting objects in the browser. Then in the dialog functions I fetched the selected entries with
import salome
salome.sg.getSelected(0) # 0 for first, 1 for second, …
# or get all selected objects
salome.sg.getAllSelected()
This retrieves you their entries and then I manually checked what they are, from which module, etc…
If you run SALOME with SALOME_VERBOSE=1 ./salome you get information what was called with what function. But I haven’t seen “dataChanged” signal or similar anywhere.