plasma listview

Rob Hasselbaum rob at hasselbaum.net
Thu Apr 8 15:54:10 CEST 2010


On Wed, Apr 7, 2010 at 6:48 PM, Reza Shah <rshah0385 at kireihana.com> wrote:
> Hi,
> Thanks for all the replies.
> In listview i can have gridview(n rows X m cols) to display thumbnail
> of items like in folderview
> or plasmamediacenter(in gridview mode),
> or something like in this screenshot
> http://kde-look.org/content/preview.php?preview=1&id=116413&file1=116413-1.png&file2=&file3=&name=Online+Photo+Effects+Service+Client
> or something like 'add widget dialog' to display thumbnails in 1 row x
> N columns gridview.
>
> What would be the suggested implementation as a reference?
>
> Thanks,
> Reza

For a "grid view" of thumbnails, you could use a Plasma::TreeView,
which despite its name, can behave exactly like a table. For an
example of this, see
http://code.google.com/p/socket-sentry/wiki/GuidedTour. (Apologies in
advance for the shameless plug.) In your case, you might use just the
Qt::DecorationRole to supply only image data in your cells. Or perhaps
take a look at the part of the Qt Model/View programming guide that
talks about QAbstractItemDelegate, which is a way to provide custom
rendering of cells in this kind of view. The guide is at
http://doc.trolltech.com/4.6/model-view-programming.html.

Another completely different approach would be to use a a
QGraphicsGridLayout with Plasma::IconWidgets or another similar widget
for each cell.

Good luck.


More information about the Plasma-devel mailing list