Results 1 to 4 of 4

Thread: No such signal QRadioButton::toggled()

  1. #1
    Join Date
    Aug 2006
    Posts
    90
    Thanks
    6
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default No such signal QRadioButton::toggled()

    The Title Says it all... "Object::connect: No such signal QRadioButton::toggled()"

    I was looking through the docs on QRadioButton and it inherits:
    void QAbstractButton::toggled ( bool checked ) [signal]

    So I tried to create the following connection like so:
    Qt Code:
    1. ...
    2. connect(ui.rbManualMode, SIGNAL(toggled()), this, SLOT(toggleManualTab()));
    3. }
    4.  
    5. void ConfigurationForm::toggleManualTab()
    6. {
    7. bool bEnableTab = ui.rbManualMode->isChecked();
    8.  
    9. ui.twConfig->setTabEnabled( 1, bEnableTab );
    10. }
    To copy to clipboard, switch view to plain text mode 

    I am trying to enable / dissable a tab based on a radio button choice. For some reason it can not send a toggled() signal. I must be missing something fundemental here because it seems too easy to mess up.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: No such signal QRadioButton::toggled()

    There is a toggled(bool) signal, not toggled().

    Try:
    Qt Code:
    1. connect( ui.rbManualMode, SIGNAL( toggled( bool ) ),
    2. this, SLOT( toggleManualTab() ) );
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jan 2006
    Location
    Ukraine, L'viv
    Posts
    57
    Thanks
    3
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: No such signal QRadioButton::toggled()

    Quote Originally Posted by jacek
    There is a toggled(bool) signal, not toggled().

    Try:
    Qt Code:
    1. connect( ui.rbManualMode, SIGNAL( toggled( bool ) ),
    2. this, SLOT( toggleManualTab() ) );
    To copy to clipboard, switch view to plain text mode 
    So isn't it has to be
    Qt Code:
    1. connect( ui.rbManualMode, SIGNAL( toggled( bool ) ),
    2. this, SLOT( toggleManualTab( bool ) ) );
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: No such signal QRadioButton::toggled()

    Quote Originally Posted by L.Marvell
    So isn't it has to be [...]
    Not with current toggleManualTab() implementation, since it doesn't take any arguments.

    With:
    Qt Code:
    1. connect( ui.rbManualMode, SIGNAL( toggled( bool ) ),
    2. this, SLOT( toggleManualTab( bool ) ) );
    To copy to clipboard, switch view to plain text mode 
    that slot should look like this:
    Qt Code:
    1. void ConfigurationForm::toggleManualTab( bool bEnableTab )
    2. {
    3. ui.twConfig->setTabEnabled( 1, bEnableTab );
    4. }
    To copy to clipboard, switch view to plain text mode 

    @bpetty:
    If you have similar slots for other tabs, consider using QSignalMapper.

Similar Threads

  1. Replies: 2
    Last Post: 17th May 2006, 21:01
  2. QSortFilterProxyModel signal and selection confusion
    By pascal123 in forum Qt Programming
    Replies: 1
    Last Post: 1st April 2006, 16:25
  3. no such signal QListBox::currentChanged()
    By jopie bakker in forum Newbie
    Replies: 2
    Last Post: 2nd March 2006, 15:17
  4. send signal from QCombobox
    By raphaelf in forum Qt Programming
    Replies: 22
    Last Post: 28th February 2006, 14:18
  5. No such signal...
    By chaimar in forum Qt Programming
    Replies: 12
    Last Post: 24th January 2006, 22:33

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.