Results 1 to 4 of 4

Thread: Where to mouse clicks go from QTableWidget headers?

  1. #1
    Join Date
    Aug 2006
    Location
    Madison, WI USA
    Posts
    153
    Thanks
    35
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Question Where to mouse clicks go from QTableWidget headers?

    My app has 2 QTableWidget objects. I need to know when the user selects a row in one of the tables by clicking on a row header. mouseReleaseEvent() tells me when the user clicks anywhere inside the table but not when a row header is clicked (which selects all cells in the table row). What can I use to trap these mouse clicks?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Where to mouse clicks go from QTableWidget headers?

    Connect to QHeaderView::sectionClicked() signal (you can obtain QHeaderView object using QTableView::horizontalHeader()).

  3. #3
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Where to mouse clicks go from QTableWidget headers?

    You want to get the QHeaderView for the table widget (using the horizontalHeader member function).

  4. #4
    Join Date
    Aug 2006
    Location
    Madison, WI USA
    Posts
    153
    Thanks
    35
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Where to mouse clicks go from QTableWidget headers?

    Thanks so much! I knew there must be an easy way but I just couldn't find it. (I'm getting Qt training... but after the first release of the product !)

Similar Threads

  1. Replies: 2
    Last Post: 24th July 2006, 18:36
  2. QStackerWidget and mouse events
    By high_flyer in forum Qt Programming
    Replies: 3
    Last Post: 25th April 2006, 19:25

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.