Model/View and plasma javascript

Thomas Fjellstrom tfjellstrom at shaw.ca
Wed Jun 30 18:07:24 CEST 2010


On June 30, 2010, Marco Martin wrote:
> On Wednesday 30 June 2010, Thomas Fjellstrom wrote:
> > I'm wondering if its possible to use a QStandardItemModel or something
> > similar to it with the javascript bindings. I tried QStandardItemModel,
> > but it doesn't seem to exist.
> > 
> > Though even if I am able to use a standard model from Qt or KDE, I
> > don't think theres a view that I'll be happy with, so I'm planning on
> > writing my own, and was wondering if anyone else would be interested
> > in what I have in mind, and if it could make it into plasma's default
> > widgets.
> > 
> > Basically its a fancy, plasma-ish tree widget (won't look like a
> > standard tree widget) where the top level items span the width, like a
> > header for a "Section", and the children can collapse under the
> > headers. I guess it would look a little like the device notifier
> > widget, but with a lot less padding or margin around the child items.
> 
> there are no bindings for qt models at the moment, there is a tree view
> proxy widget in plasma widget but i don't think is usable at all in
> javascript.
> 
> at the moment the only way to have some kind of "fake" item view is to
> iterate trough the data given from the dataengine and construct a widget
> for each item. is how microblog, opendesktop etc plasmoids work.

The problem with that is it'll make for some neigh unreadable and 
unmaintainable javascript (imo) code. I'd like to be able to change the 
groupings at a whim, which would mean a lot of crazy add/remove code.

I'm not sure I can do what I want in javascript since the bindings are 
missing a few crucial parts. I was trying it out just to learn the bindings. 
I can just as easily (or probably easier, since I'm much more familiar with 
it) do it in C++.

-- 
Thomas Fjellstrom
tfjellstrom at shaw.ca


More information about the Plasma-devel mailing list