On Tuesday 21 February 2006 16:30, Christoffer Brodd-Reijer wrote:
> I've read the files but it is a bit too much for me. I have instead
> tried to read the class references for kfiletreeview and some other
> classes, my code ended up looking like
>
> treeView = new KFileTreeView(splitter, "treeview");
>
> KURL url = KURL("/media/psp/PSP/photo");
> QString mimetype = KMimeType::findByURL(url)->name();
> KFileItem *fileItem = new KFileItem(url, mimetype, 0);
>
> KFileTreeBranch *branch = treeView->addBranch(url, "root");
> KFileTreeViewItem *viewItem = new KFileTreeViewItem(treeView, fileItem,
> branch);
>
> which apparently does not work, since no folder shows in the
> kfiletreeview. My current goal is just to show a folder in this
> kfiletreeview, nothing more than that. Keeping it simple.
>
> Thanks.


I think you have to add a column as well, like this:

KFileTreeView * ftv;
ftv = new KFileTreeView(this);
ftv->addBranch(KURL("/home/"), "Home directory");
ftv->addColumn("First column", 1000);



>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<