Results 1 to 5 of 5

Thread: Blank rows after populating a QTableWidget

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2014
    Posts
    11
    Thanks
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default Blank rows after populating a QTableWidget

    Hi!

    Sometimes I get blank rows at end of the QTableWidget after populating data. Look how it looks like:

    blankrow1.png

    Just after sorting table (clicking over header) the blank rows simply disappear:

    blankrow2.png

    What could be going on here? I double checked to confirm that I'm not setting wrong values with setRowCount(). Here is the code.

    Thanks!

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Blank rows after populating a QTableWidget

    Dynamic sorting can get confused when adding new records (see note in QSortFilterProxyModel) Try disabling sorting while you add.

  3. #3
    Join Date
    Dec 2014
    Posts
    11
    Thanks
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Blank rows after populating a QTableWidget

    This is a QTableWidget, it is populated manually, not using models. I'm trying other things here, if I have any success I will post here.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Blank rows after populating a QTableWidget

    QTableWidget is a QTableView that maintains a model internally for your convenience. The sorting functionality is inherited directly from QTableView and operates on the underlying model Did you actually try disabling sorting?

Similar Threads

  1. Replies: 2
    Last Post: 28th July 2014, 12:46
  2. QTableView showing blank rows
    By rawfool in forum Newbie
    Replies: 3
    Last Post: 8th May 2014, 01:17
  3. Populating qtablewidget with QStringlist
    By decipher in forum Newbie
    Replies: 1
    Last Post: 31st August 2012, 08:25
  4. Populating a QtableWidget using a list of custom widgets
    By gerocampo in forum Qt Programming
    Replies: 1
    Last Post: 4th August 2010, 10:28
  5. customize QTableView to add blank rows
    By rosenth in forum Qt Programming
    Replies: 2
    Last Post: 17th April 2010, 11:47

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.