Results 1 to 2 of 2

Thread: QTableView Problem

  1. #1
    Join Date
    Jun 2018
    Posts
    31
    Thanks
    8
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default QTableView Problem

    Hi, I have a problem with my QTableView where I show the values contained in a vector that has data contained in a structure. My problem is that the last value of the vector is not shown in the QTableView, I already checked the code (tableModel based on the example of Qt AddressBook) and I don't find the error, I have also tried to update the cell where this data should be contained and the last value of the vector still does not appear in the QTableView. Another question I have is because the functions like columnCount (), rowCount (), headerData () etc. of the QAbstractTableModel, do they run without being invoked? Finally, how can I highlight the first row of the QTableView (last vector data).
    Add codes.
    Thanks for your help.
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableView Problem

    Qt Code:
    1. if(index.row()>=realDataValues.size() || index.row()<=0)
    To copy to clipboard, switch view to plain text mode 

    Not your last row is not shown but your first.

  3. The following user says thank you to ChristianEhrlicher for this useful post:

    Eduardo Huerta (28th October 2019)

Similar Threads

  1. Replies: 2
    Last Post: 9th December 2015, 01:07
  2. problem with QTableView
    By jackajack01 in forum Qt Programming
    Replies: 2
    Last Post: 12th August 2012, 16:04
  3. QTableView - CSS Problem
    By Sir Rogers in forum Qt Programming
    Replies: 0
    Last Post: 14th February 2011, 19:10
  4. Qtableview problem
    By kira411 in forum Qt Programming
    Replies: 0
    Last Post: 30th July 2010, 10:34
  5. Problem about QTableView.
    By fengtian.we in forum Qt Programming
    Replies: 1
    Last Post: 31st October 2007, 23:13

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.