Results 1 to 3 of 3

Thread: How to make checkbox ReadOnly

  1. #1
    Join Date
    Oct 2009
    Posts
    66
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Question How to make checkbox ReadOnly

    I have a requirement where i can only check(or uncheck) a check-box on certain operation till that time the check-box on the ui should be in readonly but enabled mode.
    How can i have a checkbox to be able to change its state on certain operation (say button click) to make it editable else it should be enabled but read-only??

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to make checkbox ReadOnly

    It would be better if you opt for setEnabled(false) instead of read only enabled mode.
    setEnabled(false) wud also give an indication to the user that it cannot be clicked.

  3. #3
    Join Date
    Oct 2009
    Posts
    66
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Question Re: How to make checkbox ReadOnly

    Yes, with setEnable(false) the check box will not be editable but what i need is the checkbox should be enabled but state should only be changed on button click and so till that time it should be enabled but in readonly mode.

    How to do the same??

Similar Threads

  1. C++ readonly property
    By yyiu002 in forum Newbie
    Replies: 16
    Last Post: 22nd June 2010, 10:26
  2. ReadOnly problem for QTableView
    By omprakash in forum Qt Programming
    Replies: 1
    Last Post: 17th July 2008, 16:02
  3. Replies: 4
    Last Post: 6th February 2008, 14:15
  4. Readonly Model implementation requirements for QComboBox
    By DeepDiver in forum Qt Programming
    Replies: 6
    Last Post: 8th November 2007, 17:10
  5. How to set a column readonly in qtablewidgetitem
    By ashukla in forum Qt Programming
    Replies: 6
    Last Post: 8th November 2007, 13:23

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.