Results 1 to 2 of 2

Thread: Getting / setting data on QTableWidgets

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    3
    Thanked 453 Times in 435 Posts
    Wiki edits
    15

    Default Re: Getting / setting data on QTableWidgets

    QTableWidgetItem * QTableWidget::itemAt ( const QPoint & point ) const

    QTableWidgetItem * QTableWidget::itemAt ( int ax, int ay ) const

    for both the functions the parameter is point (in table widget's coordinate system), this is not row & column. This is the reason for empty in the text().

    Try using this
    QTableWidgetItem * QTableWidget::item ( int row, int column ) const

    Use the second method.
    First method should also work if Qt::UserRole is changed to Qt:: DataRole
    Last edited by Santosh Reddy; 30th October 2011 at 03:37.

Similar Threads

  1. Replies: 5
    Last Post: 10th June 2011, 11:58
  2. Using QSortFilterProxyModel with QTableWidgets
    By kremuwa in forum Qt Programming
    Replies: 5
    Last Post: 30th September 2010, 17:32
  3. setting UserRole data in QSqlTableModel
    By orgads in forum Qt Programming
    Replies: 1
    Last Post: 2nd June 2008, 10:40
  4. QStandardItem: Setting Top Column Data?
    By AaronMK in forum Qt Programming
    Replies: 2
    Last Post: 24th January 2008, 21:13
  5. QTableWidgets problems with columns
    By 3nc31 in forum Qt Programming
    Replies: 1
    Last Post: 24th October 2007, 09:47

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
  •  
Qt is a trademark of The Qt Company.