Results 1 to 4 of 4

Thread: My Slot Function

  1. #1
    Join Date
    Apr 2010
    Posts
    152
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default My Slot Function

    Hello,

    I add signal/slot through the designer and specify the custom slot function for the main form window. However when I look for that function's definition in Visual Studio I cannot find it, and hence I cannot edit it. How can I add code to the body of this slot function?

    Thanks.

  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: My Slot Function

    Designer doesn't modify your source code, it only declares that the signal or slot will exist in the widget the form is deployed on. But you have to create the actual slot (or signal) yourself in the subclass of QWidget (notice the form class doesn't inherit QWidget).
    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
    Apr 2010
    Posts
    152
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: My Slot Function

    This means I need to add "slot: myfunction(..)" declaration and definition to the QWidget class, not to the class where the connect(...) statement was added by the designer?

  4. #4
    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: My Slot Function

    Yes, something like that.
    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.


Similar Threads

  1. Q_PROPERTY WRITE function, also a slot?
    By Eos Pengwern in forum Newbie
    Replies: 2
    Last Post: 12th December 2009, 21:29
  2. Event Loop started in slot function
    By elizabeth.h1 in forum Qt Programming
    Replies: 0
    Last Post: 21st October 2009, 12:56
  3. Replies: 2
    Last Post: 19th December 2008, 15:57
  4. Why do i need to declare a function as a slot?
    By cbarmpar in forum Qt Programming
    Replies: 2
    Last Post: 31st August 2008, 20:38
  5. slot control of new function
    By tommy in forum Qt Programming
    Replies: 3
    Last Post: 11th November 2007, 03:58

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.