Results 1 to 4 of 4

Thread: tristate

  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default tristate

    HI, I need to set the semi-checked to a tristate checkBox but I don't know how;
    with below I can retrieve if it is in a semi-checked state...but how set it? Thanks
    Qt Code:
    1. if (multiCheckBox->state() == 1 ) //semi-checked
    To copy to clipboard, switch view to plain text mode 
    Regards

  2. #2
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: tristate

    Qt Code:
    1. void QCheckBox::setTristate ( bool y = TRUE )
    To copy to clipboard, switch view to plain text mode 
    a life without programming is like an empty bottle

  3. #3
    Join Date
    Apr 2006
    Location
    Minsk, Belarus
    Posts
    23
    Thanks
    3
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: tristate

    Qt Code:
    1. //Enables the tri-state for the checkbox
    2. QCheckBox::setTristate( true );
    3. //Sets the semi-checked state for the tri-state checkbox
    4. QCheckBox::setCheckState( Qt::PartiallyChecked );
    To copy to clipboard, switch view to plain text mode 

    This should help

  4. #4
    Join Date
    Dec 2014
    Posts
    2
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Windows

    Default Re: tristate

    How can I use this with checkable QGroupBox ?

Similar Threads

  1. Tristate Flag ignored in QListWidgetItem
    By ghoust26 in forum Qt Programming
    Replies: 0
    Last Post: 16th April 2008, 08:21

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
  •  
Qt is a trademark of The Qt Company.