Say hello to the ModelListModel

October 11, 2009

Preface: In my new series “Say hello to…”, I regularly present you additions to my Git-based collection of useful helper classes and smaller projects (see its very simple homepage for more information).

Yesterday, you saw me debugging models. Today, you see the result: I’ve implemented a model that lists other models.

The ModelListModel in action

The ModelListModel in action

Perhaps you find this useful for your own application (I’ll use it for fantastic new features in Palapeli’s puzzle library). In an ideal world, I would have implemented a yet more generic model, in which one can “mount” other models at arbitrary positions, but from what I know about model/view programming, this is very hard to do right (i.e., without massive memleaks).


6 Responses to “Say hello to the ModelListModel”

  1. Michał Małek Says:

    In K3b we have something very similar – K3b::MetaItemModel, you can find it at

  2. HelloU Says:

    That’s a nice KDE4 theme. Much better than that dull grey. What is it?

  3. I have something similar in Gwenview (although my version is not as generic as yours, it is designed for dir models). Since there is also something similar in K3b I think it makes sense to propose this class for inclusion in kdelibs.

  4. Exactly. We have one like that in K3b. And there is another one in Konqueror’s new bookmark system created by Edulix for the GSoC. I think it is time to compare and merge… 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s