Results 1 to 2 of 2

Thread: Cannot select QHeaderView in area reserved for resize even if resize is not enabled

  1. #1
    Join Date
    Feb 2011
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Cannot select QHeaderView in area reserved for resize even if resize is not enabled

    Hi,

    I have a QTableView that uses both vertical and horizontal headers. The resize mode of the vertical headers (for the rows) is set to QHeaderView::Fixed so that the user cannot resize the rows. The height of the rows is pretty small (19px).

    The trouble is that when I try to click in the upper part of the header (top 4px), selection of the header does not happen. This appears to be because there are a number of pixels reserved for the gripper for resizing the column header. See QHeaderViewPrivate::sectionHandleAt() (4.7.2).

    4 pixels may not seem like much, but when the total height is 19, this "dead spot" for selection is quite noticeable.

    I'm fairly new to Qt and quite new to styles but I was hoping that I could override the pixel metrics for PM_HeaderGripMargin using a stylesheet rather than in code but this doesn't seem possible.

    Anyone have any suggestions on how to make the dead zone selectable?

    Thanks,
    Dave

  2. #2
    Join Date
    Feb 2011
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Cannot select QHeaderView in area reserved for resize even if resize is not enabl

    I was able to workaround this issue by subclassing QProxyStyle and overriding pixelMetrics() to return zero.

Similar Threads

  1. resize problem with QHeaderView using qt4.5.3
    By drawat in forum Qt Programming
    Replies: 0
    Last Post: 4th August 2010, 09:42
  2. QHeaderView resize problems...
    By alexandernst in forum Newbie
    Replies: 1
    Last Post: 7th August 2009, 18:58
  3. Resize caught by select()
    By mhoover in forum Qt Programming
    Replies: 3
    Last Post: 17th July 2009, 05:04
  4. QTreeView/QHeaderView : resize handle on the left
    By Jeremy in forum Qt Programming
    Replies: 3
    Last Post: 14th May 2009, 23:43
  5. Replies: 2
    Last Post: 22nd January 2008, 17:10

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.