Results 1 to 9 of 9

Thread: How to identify data from the model in the view?

Threaded View

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

    Default How to identify data from the model in the view?

    Hello,
    I am using Qt's Model/View Programming framework. I have subclassed QAbstractItemView and QAbstractItemModel. In my situation I need to pick out certain specific parts of the model to display in a custom view. I have used a Tree structure in the model class to represent the data. In each item of the tree, I have a column that has a text string with a unique name of my data. The model only changes internally by reading data from a serial port. In the dataChanged slot in the view I check to see which index changed by looking at the string and then update the appropriate widget in the view. I am wondering if this is the best way of doing this. It seems a little hokey to me but I don't really know how else to do it. Thanks for any help!

    csmithmaui
    Last edited by csmithmaui; 16th April 2010 at 11:10. Reason: updated contents

Similar Threads

  1. Model/View Programming: a question about data
    By QAlex in forum Qt Programming
    Replies: 1
    Last Post: 10th December 2009, 18:43
  2. Table view->model->set data
    By tulsi in forum Qt Programming
    Replies: 3
    Last Post: 21st April 2009, 08:36
  3. Model-View: how to get the data from my selected rows
    By viasant in forum Qt Programming
    Replies: 5
    Last Post: 11th August 2008, 02:16
  4. data, model and tree view
    By larry104 in forum Qt Programming
    Replies: 17
    Last Post: 3rd July 2006, 14:43
  5. Model, view, resize to show all data
    By jcr in forum Qt Programming
    Replies: 2
    Last Post: 17th April 2006, 20:59

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.