Is there some kind of signal when
I’m trying to add a toolbutton to it and there is no preblem to do that on existing
qMRMLSliceWidget (there is an example in scrit repo) but when new slice widget is added I need to add the same button to it.
Thank you for help,
I also found qMRMLLayoutViewFactory::viewCreated(QWidget*) (though as I understood it always
And I reach the factory with:
qMRMLLayoutViewFactory* factory = app->
What is the preferred solution: connect to layout manager or to factory?
Adding a connection to the
viewCreated signal to every view types you are interested in should work, too. That signal emits a valid pointer to the widget that has just been created.
I may be mistaken but in the Slicer’s source code view factory viewCreated(viewWidget) signal is emitting with widget that is created with
createViewFromNode(vtkMRMLAbstractViewNode* viewNode) function that always returns nullptr
Is implementation of
QWidget* qMRMLLayoutViewFactory::createViewFromNode(vtkMRMLAbstractViewNode* viewNode) is correct?
P.S. I’m able to catch the
viewCreated signal but it is sent with
createViewFromNode method is overridden in concrete factory classes (see qMRMLLayoutManager.cxx). You can add a breakpoint at
emit viewCreated(viewWidget); and see that
viewWidget is not a nullptr.
Most likely something is wrong where you set up the connection between the signal and your slot.
I see now, thank you for explanation