Re: [Interest] QAbstractItemModel and Qml - modelData is null

2017-10-17 Thread Nuno Santos
Pierre, Thanks for the tip. It worked. I got that from an example online, but not from official documentation. IPatch extends QObject so it is basically a QObject. I have changed the cast to QObject and it is working now! Thanks! Best regards, Nuno > On 16 Oct 2017, at 22:16, Pierre-Yves Si

Re: [Interest] QAbstractItemModel and Qml - modelData is null

2017-10-16 Thread Pierre-Yves Siret
2017-10-16 20:11 GMT+02:00 Nuno Santos : > Hi, > > I have for the first time defined a QAbstractItemModel to use on Qml > because I needed to have a filtered version of this model > using QSortFilterProxyModel. > > I have the documentation here -> http://doc.qt.io/archives/ > qt-5.5/qtquick-modelv

[Interest] QAbstractItemModel and Qml - modelData is null

2017-10-16 Thread Nuno Santos
Hi, I have for the first time defined a QAbstractItemModel to use on Qml because I needed to have a filtered version of this model using QSortFilterProxyModel. I have the documentation here -> http://doc.qt.io/archives/qt-5.5/qtquick-modelviewsdata-cppmodels.html

Re: [Interest] QAbstractItemModel::layoutAboutToBeChanged

2016-03-23 Thread Dmitry Volosnykh
Bill, for example, you may have sorted rows. In this case all items are still up to date, but they are rearranged visually. So, the view may do some optimisations upon rendering this case, since the only thing it needs is to reposition old items without the need to re-read theirs data. On Thu, Mar

[Interest] QAbstractItemModel::layoutAboutToBeChanged

2016-03-23 Thread Bill Crocker
Gang: The doc for QAbstractItemModel::layoutAboutToBeChanged() says... This signal is emitted just before the layout of a model is changed. Components connected to this signal use it to adapt to changes in the model's layout. What is the "layout of a model" and how does that differ fr

Re: [Interest] QAbstractItemModel

2014-02-11 Thread Alejandro Exojo
2014-02-10 16:26 GMT+01:00 Graham Labdon : > As expected when an edit is completed my setData method gets called and I can > set the relevant items data. > However, this does not update the underlying data and I am struggling to see > how this is done. When you create a class based on QAbstractI

Re: [Interest] QAbstractItemModel

2014-02-10 Thread william.croc...@analog.com
On 02/10/2014 10:26 AM, Graham Labdon wrote: > Hi > I have just started with QAbstractItemModel and have some doubts as to > whether I am doing things in the correct way. > > I have class that (amongst other things) is storing a set of data that I want > to display in a QTreeView. > So I made a m

[Interest] QAbstractItemModel

2014-02-10 Thread Graham Labdon
Hi I have just started with QAbstractItemModel and have some doubts as to whether I am doing things in the correct way. I have class that (amongst other things) is storing a set of data that I want to display in a QTreeView. So I made a model class derived from QAbstractItemModel and have the

Re: [Interest] QAbstractItemModel::headerData

2013-11-25 Thread william.croc...@analog.com
On 11/22/2013 02:31 PM, an...@familiesomers.nl wrote: > Bill Crocker schreef op 22.11.2013 20:19: >> Gang: >> >> I have created my own item model by sub-classing QAbstractItemModel. >> >> Functions like rowCount take a parent index so the model >> knows for which index it is being asked to return t

Re: [Interest] QAbstractItemModel::headerData

2013-11-22 Thread andre
Bill Crocker schreef op 22.11.2013 20:19: > Gang: > > I have created my own item model by sub-classing QAbstractItemModel. > > Functions like rowCount take a parent index so the model > knows for which index it is being asked to return the count. > This is good. > > My model is hierarchical and

[Interest] QAbstractItemModel::headerData

2013-11-22 Thread Bill Crocker
Gang: I have created my own item model by sub-classing QAbstractItemModel. Functions like rowCount take a parent index so the model knows for which index it is being asked to return the count. This is good. My model is hierarchical and different points in the hierarchy have a different number of

Re: [Interest] QAbstractItemModel and lazy loading

2012-05-14 Thread Adam Light
Jason: On Fri, May 11, 2012 at 12:15 PM, Jason Dictos wrote: > What I’ve done to work around this is to always have a dummy item called > “Loading…” as the first item in the list. Then when that node expands, load > and replace it. That has turned out to be a pretty good user experience as > well

Re: [Interest] QAbstractItemModel and lazy loading

2012-05-14 Thread Adam Light
Hi Jan Thanks for your reply. I've responded to a few things inline below. On Mon, May 14, 2012 at 7:59 AM, Jan Kundrát wrote: > > I'd strongly encourage to check your model using ModelTest [1]. The > trouble with Qt models is that any error you make will usually result in > subtle errors or se

Re: [Interest] QAbstractItemModel and lazy loading

2012-05-14 Thread Jan Kundrát
On 05/11/12 20:25, Adam Light wrote: > I have tried emitting SourceModel::dataChanged() when a node goes from > not having children to having children, but that does not cause the view > to update correctly. Emitting layoutAboutToBeChanged()/layoutChanged() > *does* cause the view to be updated cor

Re: [Interest] QAbstractItemModel and lazy loading

2012-05-11 Thread Jason Dictos
ol the decoration of items in a tree view (I could be wrong however). -Jason From: interest-bounces+jdictos=barracuda@qt-project.org [mailto:interest-bounces+jdictos=barracuda@qt-project.org] On Behalf Of Adam Light Sent: Friday, May 11, 2012 2:26 PM To: Interest@qt-project.or

[Interest] QAbstractItemModel and lazy loading

2012-05-11 Thread Adam Light
Hi I have a QAbstractItemModel subclass SourceModel in my application. I have a QTreeView widget that displays SourceModel. SourceModel monitors data structures in my application for changes and when it detects changes it updates itself to reflect those changes. SourceModel is written to lazily