PDA

View Full Version : Qt Designer does not recognize custom slots anymore



Spooky
6th April 2011, 10:40
First of all: I know that since Qt4 you can't add custom slots in the Designer, since the whole concept has changed. Instead, you add custom slots to the class that embeds the UI defined in the form and then you can connect to these custom slots in the Designer if you wish.

Or so I thought, this feature suddenly stopped working for me in one project. When I want to connect a signal to a custom slot, I pick the class "MyClass" in the receiver column and then the slot in the slot column. However, I do not see my newly created slots there anymore.

At one point I had 3 slots called save(), load() and addView() for instance. Now I still have save() and load() defined, but I removed addView() and added other slots instead. However, in Qt Designer, when opening the form that my class uses, I still see only the old 3 custom slots and none of the new ones. How does the Designer of Qt4 determine the custom slots, what could be going wrong here?

This also does not work for manually created classes (without a wizard inside Visual Studio I mean) that use an UI file. I am not sure how this is supposed to work in general.

I use Qt 4.7.1 with Visual Studio 2008 and the Qt VS Integration 1.1.8.

wysota
6th April 2011, 11:09
You have to add the slots manually using an appropriate dialog in Designer. Designer doesn't scan your source code for slots.

mcosta
6th April 2011, 11:16
In Designer you can use "Change signals/slots..." item in the context menu to define new signals/slots and to use them

Spooky
6th April 2011, 11:20
Ok, I feel a bit stupid now. But where exactly would that dialog be? Which Context Menu?

// ah, got it, context menu of the widget/mainwindow... it seems I simply forgot about that, since I first used it, sorry for the stupid question then ;)