#include <klistview.h>
Inheritance diagram for KListView:

Public Types | |
| enum | SelectionModeExt |
Public Slots | |
| virtual void | rename (QListViewItem *item, int c) |
| void | setRenameable (int column, bool yesno=true) |
| virtual void | setItemsMovable (bool b) |
| virtual void | setItemsRenameable (bool b) |
| virtual void | setDragEnabled (bool b) |
| virtual void | setAutoOpen (bool b) |
| virtual void | setDropVisualizer (bool b) |
| void | setDropVisualizerWidth (int w) |
| virtual void | setTooltipColumn (int column) |
| virtual void | setDropHighlighter (bool b) |
| virtual void | setCreateChildren (bool b) |
| void | setSelectionModeExt (SelectionModeExt mode) |
| void | setTabOrderedRenaming (bool b) |
| bool | tabOrderedRenaming () const |
Signals | |
| void | executed (QListViewItem *item) |
| void | executed (QListViewItem *item, const QPoint &pos, int c) |
| void | doubleClicked (QListViewItem *item, const QPoint &pos, int c) |
| void | dropped (QDropEvent *e, QListViewItem *after) |
| void | dropped (KListView *list, QDropEvent *e, QListViewItem *after) |
| void | dropped (KListView *list, QDropEvent *e, QListViewItem *parent, QListViewItem *after) |
| void | dropped (QDropEvent *e, QListViewItem *parent, QListViewItem *after) |
| void | moved () |
| void | aboutToMove () |
| void | moved (QListViewItem *item, QListViewItem *afterFirst, QListViewItem *afterNow) |
| void | moved (QPtrList< QListViewItem > &items, QPtrList< QListViewItem > &afterFirst, QPtrList< QListViewItem > &afterNow) |
| void | itemRenamed (QListViewItem *item, const QString &str, int col) |
| void | itemRenamed (QListViewItem *item) |
| void | menuShortCutPressed (KListView *list, QListViewItem *item) |
| void | contextMenu (KListView *l, QListViewItem *i, const QPoint &p) |
Public Methods | |
| KListView (QWidget *parent=0, const char *name=0) | |
| virtual | ~KListView () |
| virtual void | setAcceptDrops (bool) |
| virtual bool | isExecuteArea (const QPoint &point) |
| bool | isExecuteArea (int x) |
| QPtrList< QListViewItem > | selectedItems () const |
| void | moveItem (QListViewItem *item, QListViewItem *parent, QListViewItem *after) |
| QListViewItem * | lastItem () const |
| QListViewItem * | lastChild () const |
| KLineEdit * | renameLineEdit () const |
| bool | itemsMovable () const |
| bool | itemsRenameable () const |
| bool | dragEnabled () const |
| bool | autoOpen () const |
| bool | isRenameable (int column) const |
| bool | dropVisualizer () const |
| int | tooltipColumn () const |
| bool | createChildren () const |
| bool | dropHighlighter () const |
| int | dropVisualizerWidth () const |
| SelectionModeExt | selectionModeExt () const |
| int | itemIndex (const QListViewItem *item) const |
| QListViewItem * | itemAtIndex (int index) |
| void | setFullWidth () |
| void | setFullWidth (bool fullWidth) |
| bool | fullWidth () const |
| virtual int | addColumn (const QString &label, int width=-1) |
| virtual int | addColumn (const QIconSet &iconset, const QString &label, int width=-1) |
| virtual void | removeColumn (int index) |
| void | setAlternateBackground (const QColor &c) |
| const QColor & | alternateBackground () const |
| void | saveLayout (KConfig *config, const QString &group) const |
| void | restoreLayout (KConfig *config, const QString &group) |
| virtual void | setSorting (int column, bool ascending=true) |
| int | columnSorted (void) const |
| bool | ascendingSort (void) const |
Protected Slots | |
| void | slotSettingsChanged (int) |
| void | cleanDropVisualizer () |
| void | cleanItemHighlighter () |
| void | emitContextMenu (QListViewItem *, const QPoint &, int) |
| void | emitContextMenu (KListView *, QListViewItem *) |
| void | slotOnItem (QListViewItem *item) |
| void | slotOnViewport () |
| void | slotAutoSelect () |
| void | slotHeaderChanged () |
Protected Methods | |
| bool | below (const QRect &rect, const QPoint &p) |
| bool | below (QListViewItem *i, const QPoint &p) |
| virtual bool | event (QEvent *) |
| void | emitExecute (QListViewItem *item, const QPoint &pos, int c) |
| virtual void | focusInEvent (QFocusEvent *fe) |
| virtual void | focusOutEvent (QFocusEvent *fe) |
| virtual void | leaveEvent (QEvent *e) |
| virtual QString | tooltip (QListViewItem *item, int column) const |
| virtual bool | showTooltip (QListViewItem *item, const QPoint &pos, int column) const |
| virtual void | contentsDragMoveEvent (QDragMoveEvent *event) |
| virtual void | contentsMousePressEvent (QMouseEvent *e) |
| virtual void | contentsMouseMoveEvent (QMouseEvent *e) |
| virtual void | contentsMouseDoubleClickEvent (QMouseEvent *e) |
| virtual void | contentsDragLeaveEvent (QDragLeaveEvent *event) |
| virtual void | contentsMouseReleaseEvent (QMouseEvent *) |
| virtual void | contentsDropEvent (QDropEvent *) |
| virtual void | contentsDragEnterEvent (QDragEnterEvent *) |
| virtual QDragObject * | dragObject () |
| virtual bool | acceptDrag (QDropEvent *event) const |
| virtual QRect | drawDropVisualizer (QPainter *p, QListViewItem *parent, QListViewItem *after) |
| virtual QRect | drawItemHighlighter (QPainter *painter, QListViewItem *item) |
| virtual void | startDrag () |
| virtual void | keyPressEvent (QKeyEvent *) |
| virtual void | viewportPaintEvent (QPaintEvent *) |
| void | activateAutomaticSelection () |
| void | deactivateAutomaticSelection () |
| bool | automaticSelection () const |
| virtual void | viewportResizeEvent (QResizeEvent *e) |
| virtual void | movableDropEvent (QListViewItem *parent, QListViewItem *afterme) |
| virtual void | findDrop (const QPoint &pos, QListViewItem *&parent, QListViewItem *&after) |
| void | fileManagerKeyPressEvent (QKeyEvent *) |
| int | depthToPixels (int depth) |
There is a new signal executed(). It gets connected to either QListView::clicked() or QListView::doubleClicked() depending on the KDE wide Single Click/Double Click settings. It is strongly recommended that you use this signal instead of the above mentioned. This way you donīt need to care about the current settings. If you want to get informed when the user selects something connect to the QListView::selectionChanged() signal.
Drag-and-Drop is supported with the signal dropped(), just setAcceptDrops(true) and connect it to a suitable slot. To see where you are dropping, setDropVisualizer(true). And also you'll need acceptDrag(QDropEvent*)
KListView is drag-enabled, too: to benefit from that you've got derive from it. Reimplement dragObject() and (possibly) startDrag(), and setDragEnabled(true).
Definition at line 54 of file klistview.h.
|
|
Possible selection modes. The first four correspond directly to QListView::SelectionMode, while the FileManager selection mode is defined as follows:
Additionally the current item is always selected automatically when navigating using the keyboard, except other items were selected explicitely. This way e.g. SHIFT+up/PgUp then SHIFT+down/PgDn leaves no item selected Definition at line 93 of file klistview.h. |
|
||||||||||||
|
Constructor.
The parameters |
|
|
Destructor. |
|
|
Connect to this signal if you want to do some preprocessing before a move is made, for example, to disable sorting This is sent only once per each groups of moves. That is, for each drop that is a move this will be emitted once, before KListView calls moveItem() |
|
|
Reimplemented in KFileTreeView. |
|
|
In FileManager selection mode: explicitely activate the mode in which the current item is automatically selected. |
|
||||||||||||||||
|
Reimplemented for full width support |
|
||||||||||||
|
Reimplemented for full width support |
|
|
|
|
|
|
|
|
In FileManager selection mode: return whether it is currently in the mode where the current item is selected automatically. Returns false if items were selected explicitely, e.g. using the mouse. |
|
|
|
|
||||||||||||
|
An overloaded version of below(const QRect&, const QPoint&). It differs from the above only in what arguments it takes.
Definition at line 614 of file klistview.h. References below(). |
|
||||||||||||
|
Determine whether a drop on position
Definition at line 600 of file klistview.h. Referenced by below(). |
|
|
Repaint the rect where I was drawing the drop line. |
|
|
Repaint the rect where I was drawing the drop rectangle. |
|
|
|
|
|
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly. The API is unaffected. Reimplemented in KFileTreeView. |
|
|
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly. The API is unaffected. Reimplemented in KFileTreeView. |
|
|
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly. The API is unaffected. Reimplemented in KFileTreeView. |
|
|
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly. The API is unaffected. Reimplemented in KFileTreeView. |
|
|
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly. The API is unaffected. |
|
|
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly. The API is unaffected. |
|
|
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly. The API is unaffected. |
|
|
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly. The API is unaffected. |
|
||||||||||||||||
|
This signal is emitted whenever a context-menu should be shown for item
|
|
|
For future expansions. Do not use. |
|
|
In FileManager selection mode: explicitely deactivate the mode in which the current item is automatically selected. |
|
|
Convert the depth of an item into its indentation in pixels |
|
||||||||||||||||
|
This signal gets emitted whenever the user double clicks into the listview.
This signal is more or less here for the sake of completeness. You should normally not need to use this. In most cases itīs better to use executed() instead. |
|
|
|
|
|
Reimplemented in KFileTreeView. |
|
||||||||||||||||
|
Paint the drag line. If painter is null, don't try to :) If after == 0 then the marker should be drawn at the top.
|
|
||||||||||||
|
Paint the drag rectangle. If painter is null, don't try to :)
|
|
|
|
|
||||||||||||||||
|
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
Reimplemented in KFileTreeView. |
|
||||||||||||||||||||
|
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
|
|
||||||||||||||||
|
This signal gets emitted whenever something acceptable is dropped onto the listview. This is an overloaded version of the above (provided to simplify processing drops outside of the class).
|
|
||||||||||||
|
This signal gets emitted whenever something acceptable is dropped onto the listview.
Reimplemented in KFileTreeView. |
|
|
|
|
|
The dropVisualizerWidth defaults to 4.
|
|
||||||||||||
|
Emit the contextMenu signal. This slot is for key presses. |
|
||||||||||||||||
|
Emit the contextMenu signal. This slot is for mouse actions. |
|
||||||||||||||||
|
Emit signal executed. |
|
|
Reimplemented to reload the alternate background in palette changes. |
|
||||||||||||||||
|
This signal is emitted whenever the user executes an listview item. That means depending on the KDE wide Single Click/Double Click setting the user clicked or double clicked on that item.
|
|
|
This signal is emitted whenever the user executes an listview item. That means depending on the KDE wide Single Click/Double Click setting the user clicked or double clicked on that item.
|
|
|
A special keyPressEvent (for FileManager selection mode). |
|
||||||||||||||||
|
Where is the nearest QListViewItem that I'm going to drop? |
|
|
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly. The API is unaffected. |
|
|
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly. The API is unaffected. |
|
|
Returns whether the last column is set to fit the available width. |
|
|
Same thing, but from an x coordinate only. This only checks if x is in the first column (if all columns don't show focus), without testing if the y coordinate is over an item or not. |
|
|
This function determines whether the given coordinates are within the execute area. The execute area is the part of a QListViewItem where mouse clicks or double clicks respectively generate a executed() signal. Depending on QListView::allColumnsShowFocus() this is either the whole item or only the first column.
|
|
|
|
|
|
Returns the item of |
|
|
Returns the index of |
|
|
Same as above, but without the extra information. |
|
||||||||||||||||
|
This signal gets emitted when an item is renamed via in-place renaming.
|
|
|
|
|
|
|
|
|
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly. The API is unaffected. Reimplemented in KFileDetailView. |
|
|
|
|
|
|
|
|
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly. The API is unaffected. |
|
||||||||||||
|
This signal is emitted when the shortcut key for popup-menus is pressed. Normally you should not use this, just connect a slot to signal contextMenu (KListView*, QListViewItem*, const QPoint&) to correctly handle showing context menus regardless of settings.
|
|
||||||||||||
|
Handle dropEvent when itemsMovable() is set to true. |
|
||||||||||||||||
|
This signal is emitted after all the items have been moved. It reports info for each and every item moved, in order. The first element in |
|
||||||||||||||||
|
This signal is emitted when ever the user moves an item in the list via DnD. If more than one item is moved at the same time,
|
|
|
This signal is emitted when ever the user moves an item in the list via DnD. If more than one item is moved at the same time, this signal is only emitted once. |
|
||||||||||||||||
|
Arbitrarily move |
|
|
Reimplemented for full width support |
|
||||||||||||
|
Rename column |
|
|
|
|
||||||||||||
|
Reads the list view's layout from a KConfig group as stored with saveLayout
|
|
||||||||||||
|
Saves the list view's layout (column widtsh, column order, sort column) to a KConfig group
|
|
|
|
|
|
|
|
|
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly. The API is unaffected. |
|
|
sets the alternate background background color. This only has an effect if the items are KListViewItems
|
|
|
Enable/Disable AutoOpen (not implemented currently). |
|
|
For future expansions. Do not use. |
|
|
Enable/Disable the dragging of items. It is disabled by default. |
|
|
Enable/Disable the drawing of a drop-highlighter (a rectangle around the item under the mouse cursor). It is disabled by default. |
|
|
Enable/Disable the drawing of a drop-visualizer (a bar that shows where a dropped item would be inserted). It is enabled by default, if dragging is enabled |
|
|
Set the width of the (default) drop-visualizer. If you don't call this method, the width is set to 4. |
|
|
Let the last column fit exactly all the available width. |
|
|
|
|
|
Set whether items in the list view can be moved. It is enabled by default.
|
|
|
Enables inplace-renaming of items. It is disabled by default.
|
|
||||||||||||
|
By default, if you called setItemsRenameable(true), only the first column is renameable. Use this function to enable the feature on other columns. If you want more intelligent (dynamic) selection, you'll have to derive from KListView, and override rename() and call only call it if you want the item to be renamed. |
|
|
Set the selection mode. A different name was chosen to avoid API-clashes with QListView::setSelectionMode(). |
|
||||||||||||
|
Reimplemented to remember the current sort column and order |
|
|
Enable/disable tabbing between editable cells
|
|
|
Set which column should be used for automatic tooltips.
|
|
||||||||||||||||
|
|
|
|
Process AutoSelection. |
|
|
Reacts to header changes in full width mode |
|
|
Accessory slot for AutoSelect |
|
|
Accessory slot for AutoSelect/ChangeCursorOverItem |
|
|
Update internal settings whenever the global ones change. |
|
|
This method calls dragObject() and starts the drag. Reimplement it to do fancy stuff like setting a pixmap or using a non-default DragMode |
|
|
Returns whether tab ordered renaming is enabled
|
|
||||||||||||
|
|
|
|
|
|
|
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly. The API is unaffected. |
|
|
Reimplemented for setFullWidth() |
1.2.18