Re: [Development] QML and QAbstractListModel

2013-01-14 Thread Alan Alpert
On Mon, Jan 14, 2013 at 3:37 AM, Alberto Mardegan 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 a QListModel, but th

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 us

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 tha

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 co

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

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-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 QAbstra

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 Ja

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 { > MouseAr

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, "myRol

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-11 Thread Bache-Wiig Jens
On Jan 10, 2013, at 5:46 PM, Alberto Mardegan 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 in > QAbstractListModel

Re: [Development] QML and QAbstractListModel

2013-01-10 Thread Mark
On Thu, Jan 10, 2013 at 8:06 PM, Charley Bay wrote: > 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 w

Re: [Development] QML and QAbstractListModel

2013-01-10 Thread Alan Alpert
On Thu, Jan 10, 2013 at 11:06 AM, Charley Bay 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 said "mayb

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" prope

Re: [Development] QML and QAbstractListModel

2013-01-10 Thread Alan Alpert
On Thu, Jan 10, 2013 at 8:46 AM, Alberto Mardegan 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 in > QAbstractListModel

[Development] QML and QAbstractListModel

2013-01-10 Thread Alberto Mardegan
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 - "get(index)" invocable method, retu