[Interest] QML Gridview cell's

Filip Piechocki fpiechocki at gmail.com
Mon Mar 3 08:33:52 CET 2014


Hi,
I suggest you implement filtering proxy model which will be between
GridView and you model. Then you should use this filtering model in the
GridView. To create your filtering model subclass QSortFilterProxyModel and
reimplement filterAcceptsRow(). You can either prepare a new QML type (so
you can reuse it in the future):

GridView {
    model: MyFilteringModel { sourceModel: myPlugin.stringList }
    // ...
}

Or just expose instance with your string list model set as a source model:

GridView {
    model: myPlugin.filteredStringList
    // ...
}

Best Regards,
Filip


On Mon, Mar 3, 2014 at 8:06 AM, Damian Ivanov <damianatorrpm at gmail.com>wrote:

> Hi all,
>
> I have a GridView which gets the model from a QStringlist model from c++
> GridView{... model:myPlugin.stringList;...}
>
> Now this QStringList may contain by nature duplicates.
> Is there a way I can hide them in the GridView?
> I tried in the delegate to set the item visible=false, this hides the
> item but the cell for it is still reserved and makes and empty cell,
> is it possible to hide/destroy this particular cell?
>
> Thanks in advance!!
> Damian
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140303/f3579e04/attachment.html>


More information about the Interest mailing list