Results 1 to 15 of 15

Thread: Accessing the first data item from a IndexList.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2010
    Posts
    22
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Accessing the first data item from a IndexList.

    The problem was, selectedRows() or selectedIndexes() only returned the value of the selected cell(s); it does not return the indexes of all values in the row. So the QModelIndexList editIndex would only recieve the data from "NOTES" if it was the only cell selected. It would only work properly if the entire row was selected, thus returning the correct index and it's data. Otherwise, it only returned the data of the first index in editIndex, which may or may not of been what I wanted, and the rest of the code would then look for a value that never existed.

    With what I did, I simply got the index of the the cell, then from that index, get the row value of the index (passed in the "row" parameter of model-index(row, column), and then specificied the column I wanted.

  2. #2
    Join Date
    Feb 2010
    Posts
    22
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Accessing the first data item from a IndexList.

    But once again, thanks for getting me on the right track. Your usage of of the index() function of model and .row(), got the juices flowin'.

Similar Threads

  1. QTableView : accessing the data
    By marvaneke in forum Newbie
    Replies: 10
    Last Post: 30th March 2012, 11:31
  2. Multiple File Data accessing
    By hasnatzaidi in forum Newbie
    Replies: 1
    Last Post: 28th October 2009, 16:34
  3. QTableView - data() - item
    By starcontrol in forum Qt Programming
    Replies: 1
    Last Post: 11th April 2008, 14:41
  4. Accessing data from a worker thread
    By steg90 in forum Qt Programming
    Replies: 20
    Last Post: 25th May 2007, 10:20
  5. accessing data in a QFile
    By nass in forum Qt Programming
    Replies: 1
    Last Post: 21st September 2006, 16:25

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.