QGV for the playlist, revisiting

Ian Monroe ian at monroe.nu
Thu Sep 6 06:15:50 CEST 2007


On 9/5/07, Jeff Mitchell <kde-dev at emailgoeshere.com> wrote:
> This is what I thought too.  I thought you could force a QLineEdit as
> your custom delegate...
>
> The other thing I don't really understand is: why is he using a
> QGraphicsScene to paint the items?  Is there really no less "heavy" way
> to do it?  Or is this really the proper method and I'm just not with the
> times?

Well your kind of not with the times. I'm not using a QGraphicsScene
to paint ItemDelegates like I was before. I'm not using QListView at
all. I'm only using a QGraphicsScene implicitly by using
QGraphicsView.

Its a whole QGraphicsView. Its just as heavy as any other
QGraphicsView I think (except its kind of like the QAbstractItemView
children, it only requests data for items being shown), so it should
be fine.

Really the reason I want a QGraphicsView is to allow us to do nifty
QGV stuff, if not in Amarok 2.0.0, then perhaps in future releases.
And not just animations and such, but things such as group album
tracks together would be difficult with a QListView.

Additionally displaying the data in the most basic format with inline
editing is possible with ItemDelegate but would take some work as well
and would ultimately not be as flexible.

The main issue on the horizon with using a QGraphicsView as a ItemView
is layouting. Currently it based on the assumption that every track
has the same vertical width.

Ok, anyways, I've already finished my homework for the rest of the
week. Actually this semester is really awesomely light as far as
homework is concerned. :) So I'll work on the various issues with the
QGraphicsView playlist tomorrow and Friday. I think the remaining
issues are fairly small in scope. I'll post another message then.

Here's a todo list for myself:
*Need to make a subclass of the text edit field, so that it displays
the squished text but edits the full text
*deleting my QGraphicsItem's results in segfaults. Need to figure that out! :)
*some memory management issues. (probably related with the above)
*sort out drag and dropping (there was an issue with this that
QListView had as well that I was hoping would go away with the switch
to QGV, so I there's a bit of Model work to do here)
*support resizing the playlist better, probably requires a minor
subclassing of QGraphicsScene

I'll probably start with the second 2nd and 3rd issues.

Ian


More information about the Amarok-devel mailing list