Results 1 to 4 of 4

Thread: radiobutton connect

  1. #1
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default radiobutton connect

    how to code this: if a the ON radio button is clicked, set the frame to enabled, otherwise disabled,
    here, all slots take boolean whereas the clicked signal is void!

    connect(ui->display_titleOn, SIGNAL(clicked()), ui->display_titleFrame, SLOT(setEnabled(true)));

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: radiobutton connect

    qradiobutton is a http://doc.qt.io/qt-4.8/QAbstractButton and if you look at the ACTUAL signal clicked... http://doc.qt.io/qt-4.8/QAbstractButton#clicked then you will see that the clicked signal is 'not void'
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: radiobutton connect

    You can't pass parameters via connect! And use the toggled() signal...

  4. #4
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: radiobutton connect

    he can use clicked as well.

    connect(ui->display_titleOn, SIGNAL(clicked(bool)), ui->display_titleFrame, SLOT(setEnabled(bool)));
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. tab order and QButtonGroup and radioButton
    By somename in forum Qt Programming
    Replies: 14
    Last Post: 12th January 2016, 12:00
  2. stylesheet of radiobutton
    By DEEPADEV in forum Qt Programming
    Replies: 2
    Last Post: 4th June 2012, 13:27
  3. checkbox and radiobutton in treeview
    By ErmandoFerrari in forum Qt Programming
    Replies: 1
    Last Post: 8th May 2010, 19:33
  4. radiobutton behavior on menubar
    By sp4rk3r in forum Qt Programming
    Replies: 2
    Last Post: 15th July 2008, 04:37
  5. radiobutton output file
    By nitriles in forum Qt Programming
    Replies: 5
    Last Post: 20th September 2007, 09:04

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.