• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

KDE3Support

Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes
K3FileTreeView Class Reference

#include <k3filetreeview.h>

Inheritance diagram for K3FileTreeView:
K3ListView Q3ListView

List of all members.

Public Slots

virtual void setShowFolderOpenPixmap (bool showIt=true)
- Public Slots inherited from K3ListView
virtual void rename (Q3ListViewItem *item, int c)
virtual void setAutoOpen (bool b)
virtual void setDragEnabled (bool b)
virtual void setDropHighlighter (bool b)
virtual void setDropVisualizer (bool b)
void setDropVisualizerWidth (int w)
virtual void setItemsMovable (bool b)
virtual void setItemsRenameable (bool b)
void setRenameable (int column, bool yesno=true)
void setSelectionModeExt (SelectionModeExt mode)
void setTabOrderedRenaming (bool b)
virtual void setTooltipColumn (int column)
bool tabOrderedRenaming () const

Signals

void dropped (QWidget *, QDropEvent *)
void dropped (QWidget *, QDropEvent *, KUrl::List &)
void dropped (KUrl::List &, KUrl &)
void dropped (QWidget *, QDropEvent *, KUrl::List &, KUrl &)
void dropped (QDropEvent *, Q3ListViewItem *)
void dropped (K3FileTreeView *, QDropEvent *, Q3ListViewItem *)
void dropped (QDropEvent *, Q3ListViewItem *, Q3ListViewItem *)
void dropped (K3FileTreeView *, QDropEvent *, Q3ListViewItem *, Q3ListViewItem *)
void onItem (const QString &)
- Signals inherited from K3ListView
void aboutToMove ()
void contextMenu (K3ListView *l, Q3ListViewItem *i, const QPoint &p)
void dropped (K3ListView *list, QDropEvent *e, Q3ListViewItem *after)
void dropped (K3ListView *list, QDropEvent *e, Q3ListViewItem *parent, Q3ListViewItem *after)
void executed (Q3ListViewItem *item)
void executed (Q3ListViewItem *item, const QPoint &pos, int c)
void itemAdded (Q3ListViewItem *item)
void itemRemoved (Q3ListViewItem *item)
void itemRenamed (Q3ListViewItem *item, const QString &str, int col)
void itemRenamed (Q3ListViewItem *item)
void menuShortCutPressed (K3ListView *list, Q3ListViewItem *item)
void moved ()
void moved (Q3ListViewItem *item, Q3ListViewItem *afterFirst, Q3ListViewItem *afterNow)
void moved (Q3PtrList< Q3ListViewItem > &items, Q3PtrList< Q3ListViewItem > &afterFirst, Q3PtrList< Q3ListViewItem > &afterNow)

Public Member Functions

 K3FileTreeView (QWidget *parent)
virtual ~K3FileTreeView ()
KFileTreeBranch * addBranch (const KUrl &path, const QString &name, bool showHidden=false)
virtual KFileTreeBranch * addBranch (const KUrl &path, const QString &name, const QPixmap &pix, bool showHidden=false)
virtual KFileTreeBranch * addBranch (KFileTreeBranch *)
KFileTreeBranch * branch (const QString &searchName)
KFileTreeBranchList & branches ()
K3FileTreeViewItem * currentKFileTreeViewItem () const
KUrl currentUrl () const
K3FileTreeViewItem * findItem (KFileTreeBranch *brnch, const QString &relUrl)
K3FileTreeViewItem * findItem (const QString &branchName, const QString &relUrl)
virtual bool removeBranch (KFileTreeBranch *branch)
virtual void setDirOnlyMode (KFileTreeBranch *branch, bool)
bool showFolderOpenPixmap () const
- Public Member Functions inherited from K3ListView
 K3ListView (QWidget *parent=0)
virtual ~K3ListView ()
virtual int addColumn (const QString &label, int width=-1)
virtual int addColumn (const QIcon &iconset, const QString &label, int width=-1)
const QColor & alternateBackground () const
bool ascendingSort (void) const
bool autoOpen () const
int columnSorted (void) const
bool dragEnabled () const
bool dropHighlighter () const
bool dropVisualizer () const
int dropVisualizerWidth () const
bool fullWidth () const
virtual bool isExecuteArea (const QPoint &point)
bool isExecuteArea (int x)
bool isRenameable (int column) const
Q3ListViewItem * itemAtIndex (int index)
int itemIndex (const Q3ListViewItem *item) const
bool itemsMovable () const
bool itemsRenameable () const
Q3ListViewItem * lastChild () const
Q3ListViewItem * lastItem () const
void moveItem (Q3ListViewItem *item, Q3ListViewItem *parent, Q3ListViewItem *after)
virtual void removeColumn (int index)
KLineEdit * renameLineEdit () const
void restoreLayout (KConfig *config, const QString &group)
void restoreLayout (KConfigGroup &cg)
void saveLayout (KConfig *config, const QString &group) const
void saveLayout (KConfigGroup &cg) const
QList< Q3ListViewItem * > selectedItems (bool includeHiddenItems=true) const
SelectionModeExt selectionModeExt () const
virtual void setAcceptDrops (bool)
void setAlternateBackground (const QColor &c)
void setFullWidth ()
void setFullWidth (bool fullWidth)
void setShadeSortColumn (bool shadeSortColumn)
virtual void setSorting (int column, bool ascending=true)
bool shadeSortColumn (void) const
virtual void takeItem (Q3ListViewItem *i)
int tooltipColumn () const

Protected Slots

virtual QPixmap itemIcon (K3FileTreeViewItem *, int gap=0) const
virtual void slotNewTreeViewItems (KFileTreeBranch *, const K3FileTreeViewItemList &)
virtual void slotSetNextUrlToSelect (const KUrl &url)
- Protected Slots inherited from K3ListView
void cleanDropVisualizer ()
void cleanItemHighlighter ()
void doneEditing (Q3ListViewItem *item, int row)
void emitContextMenu (Q3ListViewItem *, const QPoint &, int)
void emitContextMenu (K3ListView *, Q3ListViewItem *)
void slotAutoSelect ()
void slotDragExpand ()
void slotHeaderChanged ()
void slotMouseButtonClicked (int btn, Q3ListViewItem *item, const QPoint &pos, int c)
void slotOnViewport ()
void slotSettingsChanged (int)

Protected Member Functions

virtual bool acceptDrag (QDropEvent *event) const
virtual void contentsDragEnterEvent (QDragEnterEvent *e)
virtual void contentsDragLeaveEvent (QDragLeaveEvent *e)
virtual void contentsDragMoveEvent (QDragMoveEvent *e)
virtual void contentsDropEvent (QDropEvent *ev)
virtual Q3DragObject * dragObject ()
virtual void startAnimation (K3FileTreeViewItem *item, const char *iconBaseName="kde", uint iconCount=6)
virtual void stopAnimation (K3FileTreeViewItem *item)
- Protected Member Functions inherited from K3ListView
void activateAutomaticSelection ()
bool automaticSelection () const
bool below (const QRect &rect, const QPoint &p)
bool below (Q3ListViewItem *i, const QPoint &p)
virtual void contentsContextMenuEvent (QContextMenuEvent *)
virtual void contentsMouseDoubleClickEvent (QMouseEvent *e)
virtual void contentsMouseMoveEvent (QMouseEvent *e)
virtual void contentsMousePressEvent (QMouseEvent *e)
virtual void contentsMouseReleaseEvent (QMouseEvent *)
void deactivateAutomaticSelection ()
int depthToPixels (int depth)
void disableAutoSelection ()
void doubleClicked (Q3ListViewItem *item, const QPoint &pos, int c)
virtual QRect drawDropVisualizer (QPainter *p, Q3ListViewItem *parent, Q3ListViewItem *after)
virtual QRect drawItemHighlighter (QPainter *painter, Q3ListViewItem *item)
void emitExecute (Q3ListViewItem *item, const QPoint &pos, int c)
virtual bool event (QEvent *)
void fileManagerKeyPressEvent (QKeyEvent *)
virtual void findDrop (const QPoint &pos, Q3ListViewItem *&parent, Q3ListViewItem *&after)
virtual void focusInEvent (QFocusEvent *fe)
virtual void focusOutEvent (QFocusEvent *fe)
virtual void keyPressEvent (QKeyEvent *)
virtual void leaveEvent (QEvent *e)
virtual void movableDropEvent (Q3ListViewItem *parent, Q3ListViewItem *afterme)
void resetAutoSelection ()
virtual bool showTooltip (Q3ListViewItem *item, const QPoint &pos, int column) const
virtual void startDrag ()
virtual QString tooltip (Q3ListViewItem *item, int column) const
virtual void viewportPaintEvent (QPaintEvent *)
virtual void viewportResizeEvent (QResizeEvent *e)

Protected Attributes

KUrl m_nextUrlToSelect

Additional Inherited Members

- Public Types inherited from K3ListView
enum  SelectionModeExt {
  Single = Q3ListView::Single, Multi = Q3ListView::Multi, Extended = Q3ListView::Extended, NoSelection = Q3ListView::NoSelection,
  FileManager
}
- Properties inherited from K3ListView
QColor alternateBackground
bool autoOpen
bool dragEnabled
bool dropVisualizer
int dropVisualizerWidth
bool fullWidth
bool itemsMovable
bool itemsRenameable
bool shadeSortColumn
int tooltipColumn

Detailed Description

The filetreeview offers a treeview on the file system which behaves like a QTreeView showing files and/or directories in the file system.

K3FileTreeView is able to handle more than one URL, represented by KFileTreeBranch.

Typical usage:

  1. create a K3FileTreeView fitting in your layout and add columns to it
  2. call addBranch to create one or more branches
  3. retrieve the root item with KFileTreeBranch::root() and set it open if desired. That starts the listing.

Definition at line 53 of file k3filetreeview.h.


Constructor & Destructor Documentation

K3FileTreeView::K3FileTreeView ( QWidget *  parent)

Definition at line 40 of file k3filetreeview.cpp.

K3FileTreeView::~K3FileTreeView ( )
virtual

Definition at line 82 of file k3filetreeview.cpp.


Member Function Documentation

bool K3FileTreeView::acceptDrag ( QDropEvent *  event) const
protectedvirtual
Returns:
true if we can decode the drag and support the action

Reimplemented from K3ListView.

Definition at line 226 of file k3filetreeview.cpp.

KFileTreeBranch * K3FileTreeView::addBranch ( const KUrl &  path,
const QString &  name,
bool  showHidden = false 
)

Adds a branch to the treeview item.

This high-level function creates the branch, adds it to the treeview and connects some signals. Note that directory listing does not start until a branch is expanded either by opening the root item by user or by setOpen on the root item.

Returns:
a pointer to the new branch or zero
Parameters:
pathis the base url of the branch
nameis the name of the branch, which will be the text for column 0
showHiddensays if hidden files and directories should be visible

Definition at line 357 of file k3filetreeview.cpp.

KFileTreeBranch * K3FileTreeView::addBranch ( const KUrl &  path,
const QString &  name,
const QPixmap &  pix,
bool  showHidden = false 
)
virtual

same as the function above but with a pixmap to set for the branch.

Definition at line 366 of file k3filetreeview.cpp.

KFileTreeBranch * K3FileTreeView::addBranch ( KFileTreeBranch *  newBranch)
virtual

same as the function above but letting the user create the branch.

Definition at line 377 of file k3filetreeview.cpp.

KFileTreeBranch * K3FileTreeView::branch ( const QString &  searchName)
Returns:
a pointer to the KFileTreeBranch in the K3FileTreeView or zero on failure.
Parameters:
searchNameis the name of a branch

Definition at line 391 of file k3filetreeview.cpp.

KFileTreeBranchList & K3FileTreeView::branches ( )
Returns:
a list of pointers to all existing branches in the treeview.

Definition at line 409 of file k3filetreeview.cpp.

void K3FileTreeView::contentsDragEnterEvent ( QDragEnterEvent *  event)
protectedvirtual

Reimplemented for internal reasons.

Further reimplementations should call this function or else some features may not work correctly.

The API is unaffected.

Reimplemented from K3ListView.

Definition at line 108 of file k3filetreeview.cpp.

void K3FileTreeView::contentsDragLeaveEvent ( QDragLeaveEvent *  event)
protectedvirtual

Reimplemented for internal reasons.

Further reimplementations should call this function or else some features may not work correctly.

The API is unaffected.

Reimplemented from K3ListView.

Definition at line 164 of file k3filetreeview.cpp.

void K3FileTreeView::contentsDragMoveEvent ( QDragMoveEvent *  event)
protectedvirtual

Reimplemented for internal reasons.

Further reimplementations should call this function or else some features may not work correctly.

The API is unaffected.

Reimplemented from K3ListView.

Definition at line 130 of file k3filetreeview.cpp.

void K3FileTreeView::contentsDropEvent ( QDropEvent *  e)
protectedvirtual

Reimplemented for internal reasons.

Further reimplementations should call this function or else some features may not work correctly.

The API is unaffected.

Reimplemented from K3ListView.

Definition at line 179 of file k3filetreeview.cpp.

K3FileTreeViewItem * K3FileTreeView::currentKFileTreeViewItem ( ) const
Returns:
the current (i.e. selected) item

Definition at line 587 of file k3filetreeview.cpp.

KUrl K3FileTreeView::currentUrl ( ) const
Returns:
the URL of the current selected item.

Definition at line 592 of file k3filetreeview.cpp.

Q3DragObject * K3FileTreeView::dragObject ( )
protectedvirtual
Returns:
a dragobject encoding the current selection.
See also:
setDragEnabled()

Reimplemented from K3ListView.

Definition at line 250 of file k3filetreeview.cpp.

void K3FileTreeView::dropped ( QWidget *  ,
QDropEvent *   
)
signal
void K3FileTreeView::dropped ( QWidget *  ,
QDropEvent *  ,
KUrl::List &   
)
signal
void K3FileTreeView::dropped ( KUrl::List &  ,
KUrl &   
)
signal
void K3FileTreeView::dropped ( QWidget *  ,
QDropEvent *  ,
KUrl::List &  ,
KUrl &   
)
signal
void K3FileTreeView::dropped ( QDropEvent *  e,
Q3ListViewItem *  after 
)
signal

This signal gets emitted whenever something acceptable is dropped onto the listview.

Parameters:
eis the drop event itself (it has already been accepted)
afteris the item after which the drop occurred (or 0L, if the drop was above all items)
See also:
acceptDrop()

Reimplemented from K3ListView.

void K3FileTreeView::dropped ( K3FileTreeView *  ,
QDropEvent *  ,
Q3ListViewItem *   
)
signal
void K3FileTreeView::dropped ( QDropEvent *  e,
Q3ListViewItem *  parent,
Q3ListViewItem *  after 
)
signal

This signal gets emitted whenever something acceptable is dropped onto the listview.

This function also provides a parent, in the event that your listview is a tree

Parameters:
eis the drop event itself (it has already been accepted)
parentthe item that is to be the parent of the new item
afteris the item after which the drop occurred (or 0L, if the drop was above all items

Reimplemented from K3ListView.

void K3FileTreeView::dropped ( K3FileTreeView *  ,
QDropEvent *  ,
Q3ListViewItem *  ,
Q3ListViewItem *   
)
signal
K3FileTreeViewItem * K3FileTreeView::findItem ( KFileTreeBranch *  brnch,
const QString &  relUrl 
)

searches a branch for a K3FileTreeViewItem identified by the relative url given as second parameter.

The method adds the branches base url to the relative path and finds the item.

Returns:
a pointer to the item or zero if the item does not exist.
Parameters:
brnchis a pointer to the branch to search in
relUrlis the branch relativ url

Definition at line 626 of file k3filetreeview.cpp.

K3FileTreeViewItem * K3FileTreeView::findItem ( const QString &  branchName,
const QString &  relUrl 
)

see method above, differs only in the first parameter.

Finds the branch by its name.

Definition at line 620 of file k3filetreeview.cpp.

QPixmap K3FileTreeView::itemIcon ( K3FileTreeViewItem *  item,
int  gap = 0 
) const
protectedvirtualslot

Definition at line 475 of file k3filetreeview.cpp.

void K3FileTreeView::onItem ( const QString &  )
signal
bool K3FileTreeView::removeBranch ( KFileTreeBranch *  branch)
virtual

removes the branch from the treeview.

Parameters:
branchis a pointer to the branch
Returns:
true on success.

Definition at line 415 of file k3filetreeview.cpp.

void K3FileTreeView::setDirOnlyMode ( KFileTreeBranch *  branch,
bool  bom 
)
virtual

set the directory mode for branches.

If true is passed, only directories will be loaded.

Parameters:
branchis a pointer to a KFileTreeBranch

Definition at line 429 of file k3filetreeview.cpp.

void K3FileTreeView::setShowFolderOpenPixmap ( bool  showIt = true)
virtualslot

set the flag to show 'extended' folder icons on or off.

If switched on, folders will have an open folder pixmap displayed if their children are visible, and the standard closed folder pixmap (from mimetype folder) if they are closed. If switched off, the plain mime pixmap is displayed.

Parameters:
showIt= false displays mime type pixmap only

Definition at line 666 of file k3filetreeview.cpp.

bool K3FileTreeView::showFolderOpenPixmap ( ) const
Returns:
a flag indicating if extended folder pixmaps are displayed or not.

Definition at line 661 of file k3filetreeview.cpp.

void K3FileTreeView::slotNewTreeViewItems ( KFileTreeBranch *  branch,
const K3FileTreeViewItemList &  itemList 
)
protectedvirtualslot

Definition at line 444 of file k3filetreeview.cpp.

void K3FileTreeView::slotSetNextUrlToSelect ( const KUrl &  url)
protectedvirtualslot

Definition at line 671 of file k3filetreeview.cpp.

void K3FileTreeView::startAnimation ( K3FileTreeViewItem *  item,
const char *  iconBaseName = "kde",
uint  iconCount = 6 
)
protectedvirtual

Definition at line 539 of file k3filetreeview.cpp.

void K3FileTreeView::stopAnimation ( K3FileTreeViewItem *  item)
protectedvirtual

Definition at line 556 of file k3filetreeview.cpp.


Member Data Documentation

KUrl K3FileTreeView::m_nextUrlToSelect
protected

Definition at line 208 of file k3filetreeview.h.


The documentation for this class was generated from the following files:
  • k3filetreeview.h
  • k3filetreeview.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Jul 23 2013 20:46:33 by doxygen 1.8.1.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDE3Support

Skip menu "KDE3Support"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.10.5 API Reference

Skip menu "kdelibs-4.10.5 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal