Results 1 to 4 of 4

Thread: How to check un-check a checkbox when clicking on text

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2019
    Posts
    32
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: How to check un-check a checkbox when clicking on text

    Thanks, but unfortunately nothing happens when I click in the label, just the checkbox. I'll see if I can figure something else out.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,335
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    317
    Thanked 871 Times in 858 Posts

    Default Re: How to check un-check a checkbox when clicking on text

    unfortunately nothing happens when I click in the label
    Sounds like the model is intercepting these signals and is eating them. The only other thing I can suggest is adding an event filter on the combobox to look for mouse press events (or better mouse press / release pairs), but then that gets ugly because you'd have to deal with the open / closed state of the drop-down, and if open, determining from a pixel mouse position which specific item was clicked.

    Unlike QAbstractItemView, the combobox does not have any concept of a QItemSelectionModel (or at least it doesn't expose this in the public interface) so there is no way to interact with the selection state.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 3
    Last Post: 15th February 2017, 09:57
  2. Replies: 4
    Last Post: 9th December 2015, 17:24
  3. Replies: 3
    Last Post: 1st April 2011, 04:58
  4. Accessing check state of CheckBox in QTableWidget
    By lnxusr in forum Qt Programming
    Replies: 6
    Last Post: 22nd November 2009, 01:13
  5. Replies: 5
    Last Post: 6th March 2008, 19:04

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.