Results 1 to 3 of 3

Thread: How can i update QStandardItemModel when data changed in different place in the appl

  1. #1
    Join Date
    May 2009
    Posts
    83

    Default How can i update QStandardItemModel when data changed in different place in the appl

    Hello
    im using QStandardItemModel to load data from data structure that is singleton in my application and treeview to display . this data structure is updated each N seconds , how can i update the model every time this singleton got updated ?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: How can i update QStandardItemModel when data changed in different place in the a

    Call QStandardItemModel::setData() with the new data?

  3. #3
    Join Date
    Mar 2011
    Posts
    63
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    11
    Thanked 5 Times in 5 Posts

    Default Re: How can i update QStandardItemModel when data changed in different place in the a

    Or you could use the void QAbstractItemModel::beginResetModel () and the void QAbstractItemModel::endResetModel () for the model to query for the data again.

Similar Threads

  1. Replies: 6
    Last Post: 25th June 2011, 11:35
  2. Replies: 2
    Last Post: 9th August 2010, 17:53
  3. Replies: 12
    Last Post: 24th July 2010, 08:12
  4. Update to 4.4.2: cornerWidget functionality changed
    By mclark in forum Qt Programming
    Replies: 5
    Last Post: 21st November 2008, 01:14
  5. Informing a model its data has changed
    By saknopper in forum Newbie
    Replies: 3
    Last Post: 17th January 2007, 19:58

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.