Search code examples
qtsignals-slotsqt-designer

Signal and slot connection in .ui


I have started to play a little with Qt 4. And then I have come across a problem with the Qt Designer.
In the Signal/Slots editor I can only setup the connections that are listed there, and not all the slots are listed.

If I try to add it manualy in the .ui file, the connection would not work.
If I add it in the ui_*.h file it works fine, but then the connection is deleted when I change the design.

Does anyone have any good tips to how I can get around this bug? Or to ask another way:
How can I make the Qt Designer list all the available slots?


Solution

  • By default not all signals/slots are shown. You could try checking the "show signals and slots inheritied from ...." checkbox in the lower left hand corder of the "Configure Connection" dialog that comes up when you try to create a signal.

    Beyond that, you can either do what Marcin said and use auto-connections, or manually write connect statements in the constructor of the object that uses the ui.