Results 1 to 3 of 3

Thread: Signal and slot in Creator

  1. #1
    Join Date
    Aug 2010
    Posts
    107
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Signal and slot in Creator

    I have a form with a couple of buttons and a stacked widget. The pages of the stacked widget are shown by clicking on the buttons. I am using Creator. When I go to the Signal/Slot editor and drag the signal of one of the buttons to the stacked widget, it shows a list of signals and slots. One of the slots is the setCurrentIndex() function. However, when you choose any of the available signal functions, the setCurrentIndex() function is no longer available. I can code this functionality by hand, but curious why I am getting this problem?

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Signal and slot in Creator

    It will only show slots which match the signature of the signal. Since setCurrentIndex() requires the index to set, and a button doesn't emit such a signal, it doesn't allow you to select that slot.

    Just because you can do it by hand doesn't mean it'll work. The signatures must match.

  3. #3
    Join Date
    Aug 2010
    Posts
    107
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Signal and slot in Creator

    I am still trying to learn creator. I can hand code a function on_button_clicked...just thought I could do it through the Signals/Slots Editor....thanks for your help!!!

Similar Threads

  1. QT Creator won't recognize a slot
    By lucasvickers in forum Newbie
    Replies: 4
    Last Post: 1st April 2013, 00:33
  2. Signal connected to slot (or signal)
    By Althor in forum Newbie
    Replies: 2
    Last Post: 6th July 2010, 10:00
  3. Replies: 1
    Last Post: 8th November 2007, 17:11
  4. QT4 signal/slot
    By incapacitant in forum Newbie
    Replies: 2
    Last Post: 14th March 2006, 11:30
  5. signal slot conection using a string, not a SLOT
    By rianquinn in forum Qt Programming
    Replies: 6
    Last Post: 5th February 2006, 18:52

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.