Results 1 to 1 of 1

Thread: Wrong index row required in QAbstractItemModel implementation

  1. #1
    Join Date
    Dec 2008
    Location
    Irkutsk, Russia
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Wrong index row required in QAbstractItemModel implementation

    I have complex structure of data and model to access to it.
    Qt Code:
    1. Item (single value)
    2. |
    3. +-Item (single value)
    4. |
    5. +-Factory (single value)
    6. | |
    7. | +-Table (rows, columns)
    8. |
    9. +-Factory (single value)
    10. |
    11. +-Table (rows, columns)
    To copy to clipboard, switch view to plain text mode 
    Elements of data stored in classes inherited from BaseItem class (in QModelIndex::internalPointer). To understand which implementation of BaseItem I have in current QModelIndex I use dynamic_cast<class name>.

    I return correct rowCount and columnCount for each of structure elements, but on "Factory level" row of required row is -1 (in index method). Why view (I use QTreeView) asked for index of row -1?

    P.S. Code is in attachment.
    Attached Files Attached Files

Similar Threads

  1. implementation of QabstractItemModel problem
    By mikelantonio in forum Newbie
    Replies: 2
    Last Post: 7th August 2009, 16:31
  2. Qtopia core 4.2.2 cross compile make error
    By smiyai18 in forum Installation and Deployment
    Replies: 2
    Last Post: 28th August 2007, 17:04

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.