Results 1 to 4 of 4

Thread: Qt Designer does not recognize custom slots anymore

  1. #1
    Join Date
    Jan 2011
    Posts
    21
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Qt Designer does not recognize custom slots anymore

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt Designer does not recognize custom slots anymore

    You have to add the slots manually using an appropriate dialog in Designer. Designer doesn't scan your source code for slots.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Designer does not recognize custom slots anymore

    In Designer you can use "Change signals/slots..." item in the context menu to define new signals/slots and to use them
    A camel can go 14 days without drink,
    I can't!!!

  4. #4
    Join Date
    Jan 2011
    Posts
    21
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Designer does not recognize custom slots anymore

    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

Similar Threads

  1. QT Designer and autorecognizing slots
    By QPlace in forum Qt Tools
    Replies: 1
    Last Post: 16th May 2009, 19:11
  2. Creating slots in Designer
    By Cruz in forum Qt Tools
    Replies: 1
    Last Post: 17th February 2009, 20:08
  3. Replies: 12
    Last Post: 23rd June 2008, 09:05
  4. Replies: 2
    Last Post: 12th July 2007, 10:55
  5. Adding slots in Designer
    By jamos in forum Qt Tools
    Replies: 5
    Last Post: 19th May 2006, 00:28

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.