Results 1 to 3 of 3

Thread: Read-only QCheckBox

  1. #1
    Join Date
    Mar 2008
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Read-only QCheckBox

    Hello,

    how can I put a QCheckBox in read-only mode. Which means that the user can only read but not change the state of the box.
    The application still has full control over the box.

    How is that done in Qt?

    Thanks in advance

    Alu

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Read-only QCheckBox

    subclass QCheckBox, override mousePressEvent/mouseReleaseEvent and do nothing there.

  3. #3
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Read-only QCheckBox

    Hi,

    Also you can set it disabled and so, it will be showed as disabled but you can set it checked or unchecked by code.
    Òscar Llarch i Galán

Similar Threads

  1. Read URL from a browser using Qt
    By sabeesh in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 08:11
  2. How to read Raw Information from CD in MAC?
    By vishal.chauhan in forum General Programming
    Replies: 0
    Last Post: 10th July 2007, 12:26
  3. How to read CD with read?
    By vishal.chauhan in forum Qt Programming
    Replies: 6
    Last Post: 29th June 2007, 08:20
  4. QIODevice read()
    By ShaChris23 in forum Newbie
    Replies: 1
    Last Post: 3rd May 2007, 00:29
  5. Replies: 13
    Last Post: 1st June 2006, 14:01

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.