Add and connect properly GUI components to Slicer module


I come here again for a basic question … how to add and connects UI components like button and all in a new Loadable (so c++) module ?

I found how to add: The UI file that i can open with Qt and add any component i want, but i dont know how to connect them properly …. nether where to do it.

I got the base qSlicerModuleNameFooBarWidget and other file with “Widget” in their name …
But if i want to connect the basic “foo bar” button (created by default), how and where i should do this ?

(I’m working with Visual Studio)

Usually you create all connections in the widget’s setup method. You can use all of Slicer’s loadable modules as examples. For example, see source code of Tables module widget.

Alright, thanks for your answer :slight_smile: .