[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: More on KParts
From:       Christoffer Brodd-Reijer <ephracis () linux ! se>
Date:       2006-02-21 15:30:07
Message-ID: 43FB31FF.7080906 () linux ! se
[Download RAW message or body]

Jens Herden wrote:
> On Monday 20 February 2006 17:32, David Faure wrote:
>> On Monday 20 February 2006 11:28, Christoffer Brodd-Reijer wrote:
>>> Well, currently I am trying out the "Tree View" of konqueror but I don't
>>> mind changing that if there is a better part to serve the purpose I was
>>> describing earlier.
>> I think you should use the KFileTreeView class (from libkio,
>> kdelibs/kio/kfile/) so that you have more control over the tree view.
> 
> Yes and if you want some code that uses it to get inspiration from you can 
> look in:
> 	kdewebdev/quanta/treeviews
> 
> Especially basetreeview.cpp/.h can give you some ideas. 
> 
> Jens
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.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic