Results 1 to 2 of 2

Thread: CheckStateRole: multiple checkstates and click events

  1. #1
    Join Date
    Jun 2012
    Posts
    25
    Thanks
    7
    Qt products
    Qt4
    Platforms
    MacOS X

    Default CheckStateRole: multiple checkstates and click events

    My goal is to have 2 checkstates in my QAbstractItemTable instead of one, and therefor two checkboxes per row. I did not come up with much after searching, any suggestions or links would be appreciated. My assumption is I'll have to override the paint method and perhaps define a new role, is this feasible?

    Also, looking for a good approach on how to catch the click on the checkboxes; specifically wanting to allow the user to check/uncheck each row without changing the selection. So far I've implemented the event method and handle the click event, but unsure how to test if the click event was clicked on the checkbox or the row.

    TYVM for any feedback.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: CheckStateRole: multiple checkstates and click events

    Quote Originally Posted by BreakBad View Post
    My assumption is I'll have to override the paint method and perhaps define a new role, is this feasible?
    Yes.

    Also, looking for a good approach on how to catch the click on the checkboxes
    QAbstractItemDelegate::editorEvent()
    but unsure how to test if the click event was clicked on the checkbox or the row.
    You have to calculate that the same way as you calculate where to draw the checkbox.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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

    BreakBad (18th July 2012)

Similar Threads

  1. How to get mouse click events outside the Qt window?
    By montylee in forum Qt Programming
    Replies: 11
    Last Post: 13th July 2015, 21:55
  2. Replies: 2
    Last Post: 16th July 2012, 12:40
  3. Creating click events for label
    By InterFiction in forum Newbie
    Replies: 9
    Last Post: 25th November 2011, 02:31
  4. QGrsphicsItem click and hover events
    By liqxpil in forum Newbie
    Replies: 3
    Last Post: 21st October 2010, 10:51
  5. Click events
    By Maluko_Da_Tola in forum Newbie
    Replies: 0
    Last Post: 26th August 2010, 01:05

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.