Results 1 to 2 of 2

Thread: Disable a QRadioButton without disabling its text

  1. #1
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    18
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Disable a QRadioButton without disabling its text

    Hi,

    is there a way to disable a QRadioButton without disabling its text ? If you do the following:

    Qt Code:
    1. QRadioButton button = new QRadioButton(tr("Custom"));
    2. button->setEnabled(false);
    To copy to clipboard, switch view to plain text mode 

    This will disable both the button and "Custom".

    Actually it doesn't bother me if the text is also disabled. But in this case I would like to modify the text's color from grey to black.

    Any suggestions ?

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Disable a QRadioButton without disabling its text

    Try setting QPalette:isabled color to one you want..

  3. The following user says thank you to nish for this useful post:

    ouekah (12th April 2010)

Similar Threads

  1. change text color on QRadioButton
    By vonCZ in forum Newbie
    Replies: 4
    Last Post: 7th November 2012, 20:05
  2. qRadioButton and focus
    By rajeshs in forum Qt Programming
    Replies: 2
    Last Post: 4th March 2008, 08:09
  3. Unchecking QRadioButton
    By gruszczy in forum Qt Programming
    Replies: 3
    Last Post: 26th February 2008, 00:55
  4. QRadioButton
    By sonuani in forum Newbie
    Replies: 1
    Last Post: 20th February 2008, 09:30
  5. QRadioButton
    By sabeesh in forum Qt Programming
    Replies: 3
    Last Post: 8th October 2007, 07:25

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.