Results 1 to 3 of 3

Thread: How To keep the 1st row of QTableWidget empty (Frozen Row)

  1. #1
    Join Date
    Apr 2012
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default How To keep the 1st row of QTableWidget empty (Frozen Row)

    Hi,
    I have a little Problem with a frozen row I implemented. Reference.

    In the 1st Row of my Table I have a number of widgets (multiSelect ComboBoxes) as input for filters to create new views. I reimplemented the frozen column example for rows and it almost works. The reason why I chose a frozen Row is: it stays in place while scrolling, and it doesn't change position when sorting is enabled.

    The problem is that the frozen Row covers the 1st line of my data in the table. So how can I leave the 1st row of my QTableWidget empty while sorting is enabled?

    thx for any help

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

    Default Re: How To keep the 1st row of QTableWidget empty (Frozen Row)

    You can move the whole viewport down by subclassing and reimplementing resize event for the table and using setViewportMargins() to enlarge the distance between top of the table and the viewport and reposition the header so that there is the header, then some empty space (for the frozen row) and then the viewport. You can also place the frozen row there directly to have everything embedded in a single widget.
    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:

    powlee (8th March 2013)

  4. #3
    Join Date
    Apr 2012
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How To keep the 1st row of QTableWidget empty (Frozen Row)

    thanks this sounds good. If you are not to busy would you mind giving me a small example/snippet of how to do so? Much appreciated.

Similar Threads

  1. QTableWidget frozen Column
    By Qiieha in forum Qt Programming
    Replies: 1
    Last Post: 16th November 2011, 15:55
  2. Replies: 2
    Last Post: 8th October 2010, 17:12
  3. Filling empty cells in QTableWidget
    By lyucs in forum Newbie
    Replies: 2
    Last Post: 20th October 2009, 17:12
  4. QTableWidget test if the cell or item are empty
    By jaca in forum Qt Programming
    Replies: 2
    Last Post: 2nd January 2008, 14:47
  5. QTableWidget click in empty space results in error?
    By Giel Peters in forum Qt Programming
    Replies: 4
    Last Post: 21st January 2006, 00:07

Tags for this Thread

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.