Re: [Development] QML and QAbstractListModel

2013-01-14 Thread André Somers
Op 10-1-2013 17:46, Alberto Mardegan schreef: Hi all! I'd like to make C++ models more usable from QML; in the net there are several blog posts illustrating how to achieve that, but IMHO it would be better if at least some of these handy features were in QAbstractListModel itself: -

Re: [Development] QML and QAbstractListModel

2013-01-14 Thread Andrew den Exter
Perhaps an alternative approach would be to create a proxy model for exporting to QML. It could include all the methods you need, but it would not complicate QAIM itself. It seems to me that all the methods you need can be implemented in terms of the already existing functionality in QAIM, so

Re: [Development] QML and QAbstractListModel

2013-01-14 Thread Alberto Mardegan
On 01/14/2013 09:29 AM, André Somers wrote: I am not fan of this change. I think the API of QAIM is already very complex. Adding more methods that basically only sort-of mirror existing methods but for a more confined use-cases only makes that situation worse. For instance, you now get a

Re: [Development] QML and QAbstractListModel

2013-01-14 Thread André Somers
Op 14-1-2013 11:07, Alberto Mardegan schreef: On 01/14/2013 09:29 AM, André Somers wrote: I am not fan of this change. I think the API of QAIM is already very complex. Adding more methods that basically only sort-of mirror existing methods but for a more confined use-cases only makes that

Re: [Development] QML and QAbstractListModel

2013-01-14 Thread Alberto Mardegan
On 01/14/2013 11:37 AM, André Somers wrote: [...] top of them. Note that you can also use a proxy to map a table model to a list by mapping the data in columns to different roles. The base class would not be a QListModel, but the data would be available from the first column anyway. When using

Re: [Development] QML and QAbstractListModel

2013-01-14 Thread Alan Alpert
On Mon, Jan 14, 2013 at 3:37 AM, Alberto Mardegan ma...@users.sourceforge.net wrote: On 01/14/2013 11:37 AM, André Somers wrote: [...] top of them. Note that you can also use a proxy to map a table model to a list by mapping the data in columns to different roles. The base class would not be

Re: [Development] QML and QAbstractListModel

2013-01-13 Thread Alberto Mardegan
On 01/12/2013 11:59 PM, Nils Jeisecke wrote: Hi, what about adding a new Quick item for enhanced QAbstractItemModel access. ListModelAdapter { id: myModelAdapter sourceModel: myModel } ListView { model: myModelAdapter.sourceModel delegate: Text { MouseArea {

Re: [Development] QML and QAbstractListModel

2013-01-13 Thread Johan Thelin
Sorry for top-posting. I'm writing from my phone. I've had a class like this for a project of mine. It exposed signals for adding, removing and changing rows as well as the count, data and setData methods. This helped me peek and poke at a QAbstractLisaModel from JavaScript. Cheers, Johan On

Re: [Development] QML and QAbstractListModel

2013-01-13 Thread Joseph Crowell
On 01/13/2013 10:09 PM, Johan Thelin wrote: Sorry for top-posting. I'm writing from my phone. I've had a class like this for a project of mine. It exposed signals for adding, removing and changing rows as well as the count, data and setData methods. This helped me peek and poke at a

Re: [Development] QML and QAbstractListModel

2013-01-12 Thread Alberto Mardegan
On 01/10/2013 05:46 PM, Alberto Mardegan wrote: I'd like to make C++ models more usable from QML; in the net there are several blog posts illustrating how to achieve that, but IMHO it would be better if at least some of these handy features were in QAbstractListModel itself: - count

Re: [Development] QML and QAbstractListModel

2013-01-12 Thread Nils Jeisecke
Hi, what about adding a new Quick item for enhanced QAbstractItemModel access. ListModelAdapter { id: myModelAdapter sourceModel: myModel } ListView { model: myModelAdapter.sourceModel delegate: Text { MouseArea { onClicked: console.log(myModelAdapter.data(model.index, myRole)

Re: [Development] QML and QAbstractListModel

2013-01-11 Thread Bache-Wiig Jens
On Jan 10, 2013, at 5:46 PM, Alberto Mardegan ma...@users.sourceforge.net wrote: Hi all! I'd like to make C++ models more usable from QML; in the net there are several blog posts illustrating how to achieve that, but IMHO it would be better if at least some of these handy features were

Re: [Development] QML and QAbstractListModel

2013-01-10 Thread Alan Alpert
On Thu, Jan 10, 2013 at 8:46 AM, Alberto Mardegan ma...@users.sourceforge.net wrote: Hi all! I'd like to make C++ models more usable from QML; in the net there are several blog posts illustrating how to achieve that, but IMHO it would be better if at least some of these handy features were

Re: [Development] QML and QAbstractListModel

2013-01-10 Thread Charley Bay
Alberto sayeth: Hi all! I'd like to make C++ models more usable from QML; in the net there are several blog posts illustrating how to achieve that, but IMHO it would be better if at least some of these handy features were in QAbstractListModel itself: - count property -

Re: [Development] QML and QAbstractListModel

2013-01-10 Thread Alan Alpert
On Thu, Jan 10, 2013 at 11:06 AM, Charley Bay charleyb...@gmail.com wrote: QUESTION: Alan seems to suggest the (C++) QAIM/QML might be changed/updated in the near-future (and that was the purpose for the question in this thread). Is that to handle the model or the item, or both? Whoa, when I