Review Request: Make it possible to use Tree models from QML

Aleix Pol Gonzalez aleixpol at gmail.com
Fri Aug 31 15:44:15 UTC 2012



> On Aug. 31, 2012, 1:18 p.m., Aurélien Gâteau wrote:
> > plasma/declarativeimports/qtextracomponents/fullmodelaccess.cpp, line 123
> > <http://git.reviewboard.kde.org/r/106272/diff/2-3/?file=82326#file82326line123>
> >
> >     I am actually wondering if hitting this condition is really weird:
> >     
> >     From QML, setting the model can only be done through the rootIndex property, so if I am using the model to filter model1 and then want to change it to filter model2, I am going to pass to setRootIndex() an index which is not from the current source model.

You are correct, I added this when I didn't get the model from the index.
It's really convenient to get it from the index, though, because otherwise you get to weird states because you don't know when the model when setting the index.

I removed the warning.


- Aleix


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/106272/#review18325
-----------------------------------------------------------


On Aug. 31, 2012, 7:53 a.m., Aleix Pol Gonzalez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/106272/
> -----------------------------------------------------------
> 
> (Updated Aug. 31, 2012, 7:53 a.m.)
> 
> 
> Review request for Plasma, Aurélien Gâteau and Marco Martin.
> 
> 
> Description
> -------
> 
> This patch adds a component called ListifyModel (yeah, I hate the name too). The idea behind is to expose as a QAbstractListModel any part of a QAbstractItemModel.
> 
> This solves the problem we have in QML given the limitation that ListView only displays the first column of the root items. Here we can specify what column we want and what root index we want to have.
> 
> 
> Diffs
> -----
> 
>   plasma/declarativeimports/qtextracomponents/CMakeLists.txt 05a1195 
>   plasma/declarativeimports/qtextracomponents/fullmodelaccess.h PRE-CREATION 
>   plasma/declarativeimports/qtextracomponents/fullmodelaccess.cpp PRE-CREATION 
>   plasma/declarativeimports/qtextracomponents/qtextracomponentsplugin.cpp 429282e 
>   plasma/declarativeimports/qtextracomponents/tests/CMakeLists.txt PRE-CREATION 
>   plasma/declarativeimports/qtextracomponents/tests/fullmodelaccesstest.h PRE-CREATION 
>   plasma/declarativeimports/qtextracomponents/tests/fullmodelaccesstest.cpp PRE-CREATION 
> 
> Diff: http://git.reviewboard.kde.org/r/106272/diff/
> 
> 
> Testing
> -------
> 
> There's a passing unit test, albeit limited.
> I also tested it with a QML example I had with KPeople. If anybody is interested I can provide it too.
> 
> 
> Thanks,
> 
> Aleix Pol Gonzalez
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20120831/0bc16c95/attachment.html>


More information about the Plasma-devel mailing list