|
|
This Widget extends the functionality of QListView to honor the system wide settings for Single Click/Double Click mode, AutoSelection and ChangeCursorOverLink (TM).
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).
enum |
Possible selection modes.
The first four correspond directly to QListView::SelectionMode, while the Konqueror selection mode is defined as follows:
The combinations work the same with SHIFT instead of CTRL, except that if you start selecting something using SHIFT everything selected before will be deselected first.
This way e.g. SHIFT+up/PgUp then SHIFT+down/PgDn leaves no item selected
|
Constructor.
The parameters parent
and name
are handled by
QListView, as usual.
|
[virtual]
Destructor.
void |
[virtual]
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly.
The API is unaffected.
bool |
[virtual]
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: true if point is inside execute area of an item, false in all other cases including the case that it is over the viewport.
bool |
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.
QList<QListViewItem> |
[const]
Returns: a list containing the currently selected items.
void |
Arbitrarily move item
to parent,
positioned immediately after item after.
QListViewItem * |
[const]
Returns: the last item (not child!) of this listview.
See also: lastChild()
QListViewItem* |
[const]
Returns: the last child of this listview.
bool |
[const]
Returns: if it is legal to move items in the list view
bool |
[const]
Returns: whether inplace-renaming has been enabled.
See also: setItemsRenameable()
bool |
[const]
Returns: whether dragging is enabled.
bool |
[const]
Returns: true if AutoOpen is enabled (not implemented currently).
See also: setAutoOpen()
bool |
[const]
Returns: true if column
is renamable.
bool |
[const]
Returns: true if drawing of the drop-visualizer has been enabled.
int |
[const]
Returns: the column for which tooltips are displayed (or -1 if none set).
bool |
[const]
For future expansions.
Do not use.
bool |
[const]
For future expansions.
Do not use.
int |
[const]
The dropVisualizerWidth defaults to 4.
Returns: the current width of the drop-visualizer.
SelectionModeExt |
[const]
Returns: the "extended" selection mode of this listview.
See also: SelectionModeExt, setSelectionModeExt
int |
[const]
Returns the index of item
within the item tree or -1 if
item
doesn't exist in this list view. This function takes
all items into account not only the visible ones.
QListViewItem* |
Returns the item of index
within the item tree or 0 if
index
doesn't exist in this list view. This function takes
all items into account not only the visible ones.
void |
[signal]
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.
Note that you may not delete any QListViewItem objects in slots connected to this signal.
Parameters:
item | is the pointer to the executed listview item. |
void |
[signal]
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.
Note that you may not delete any QListViewItem objects in slots connected to this signal.
Parameters:
item | is the pointer to the executed listview item. |
pos | is the position where the user has clicked |
c | is the column into which the user clicked. |
void |
[signal]
This signal gets emitted whenever the user double clicks into the listview.
Note that you may not delete any QListViewItem objects in slots connected to this signal.
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.
Parameters:
item | is the pointer to the clicked listview item. |
pos | is the position where the user has clicked, and |
c | is the column into which the user clicked. |
void |
[signal]
This signal gets emitted whenever something acceptable is dropped onto the listview.
Parameters:
e | is the drop event itself (it has already been accepted) |
after | is the item after which the drop occured (or 0L, if the drop was above all items) |
See also: acceptDrop()
void |
[signal]
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).
Parameters:
list | is the listview |
e | is the drop event itself (it has already been accepted) |
after | is the item after which the drop occured (or 0L, if the drop was above all items |
void |
[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:
list | is the listview |
e | is the drop event itself (it has already been accepted) |
parent | the item that is to be the parent of the new item |
after | is the item after which the drop occured (or 0L, if the drop was above all items |
void |
[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:
e | is the drop event itself (it has already been accepted) |
parent | the item that is to be the parent of the new item |
after | is the item after which the drop occured (or 0L, if the drop was above all items |
void |
[signal]
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.
void |
[signal]
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, afterFirst
and
afterNow
will reflect what was true before the move.
This differs from moved(), so be careful. All the items will have been
moved before moved() is emitted, which is not true in this method. // FIXME
Parameters:
item | the item that was moved |
afterFirst | the item that parameter item was in before the move, in the list |
afterNow | the item it's currently after. |
void |
[signal]
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 items
associates
with the first of afterFirst and afterNow.
void |
[signal]
This signal gets emitted when an item is renamed via in-place renaming.
Parameters:
item | is the renamed item. |
str | is the new value of column col.
|
col | is the renamed column. |
void |
[signal]
Same as above, but without the extra information.
void |
[signal]
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.
Parameters:
list | is this listview. |
item | is the currentItem() at the time the key was pressed. May be 0L. |
void |
[signal]
This signal is emitted whenever a context-menu should be shown for item i.
It automatically adjusts for all settings involved (Menu key, showMenuOnPress/Click).
Parameters:
l | is this listview. |
i | is the item for which the menu should be shown. May be 0L. |
p | is the point at which the menu should be shown. |
void |
[virtual slot]
Rename column c
of item.
void |
[slot]
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.
void |
[virtual slot]
Set whether items in the list view can be moved. It is enabled by default.
See also: itemsMovable()
void |
[virtual slot]
Enables inplace-renaming of items. It is disabled by default.
See also: itemsRenameable(), setRenameable()
void |
[virtual slot]
Enable/Disable the dragging of items. It is disabled by default.
void |
[virtual slot]
Enable/Disable AutoOpen (not implemented currently).
void |
[virtual slot]
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
void |
[slot]
Set the width of the (default) drop-visualizer. If you don't call this method, the width is set to 4.
void |
[virtual slot]
Set which column should be used for automatic tooltips.
Parameters:
column | is the column for which tooltips will be shown. Set -1 to disable this feature. |
void |
[virtual slot]
For future expansion.
Do not use.
void |
[virtual slot]
For future expansions.
Do not use.
void |
[slot]
Set the selection mode.
A different name was chosen to avoid API-clashes with QListView::setSelectionMode().
inline bool |
[protected: ]
Determine whether a drop on position p
would count as
being above or below the QRect rect.
Parameters:
rect | is the rectangle we examine. |
p | is the point located in the rectangle, p is assumed to be in viewport coordinates. |
inline bool |
[protected: ]
An overloaded version of below(const QRect&, const QPoint&).
It differs from the above only in what arguments it takes.
Parameters:
i | the item whose rect() is passed to the above function. |
p | is translated from contents coordinates to viewport coordinates before being passed to the above function. |
void |
[protected: ]
Emit signal execute.
void |
[protected: virtual]
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly.
The API is unaffected.
void |
[protected: virtual]
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly.
The API is unaffected.
void |
[protected: virtual]
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly.
The API is unaffected.
QString |
[protected: const virtual]
Returns: the tooltip for column
of item.
bool |
[protected: const virtual]
Returns: whether the tooltip for column
of item
shall be shown at point pos.
void |
[protected: virtual]
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly.
The API is unaffected.
void |
[protected: virtual]
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly.
The API is unaffected.
void |
[protected: virtual]
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly.
The API is unaffected.
void |
[protected: virtual]
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly.
The API is unaffected.
void |
[protected: virtual]
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly.
The API is unaffected.
void |
[protected: virtual]
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly.
The API is unaffected.
void |
[protected: virtual]
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly.
The API is unaffected.
void |
[protected: virtual]
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly.
The API is unaffected.
QDragObject * |
[protected: const virtual]
Returns: a dragobject encoding the current selection.
See also: setDragEnabled()
bool |
[protected: const virtual]
Returns: true if the event
provides some acceptable
format.
QRect |
[protected: virtual]
Paint the drag line. If painter is null, don't try to :)
If after == 0 then the marker should be drawn at the top.
Returns: the rectangle that you painted to.
QRect |
[protected: virtual]
For future expansion.
Do not use.
Highlight item.
painter may be null
return the rect drawn to
void |
[protected: virtual]
This method calls dragObject() and starts the drag.
Reimplement it to do fancy stuff like setting a pixmap or using a non-default DragMode
void |
[protected: virtual]
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly.
The API is unaffected.
void |
[protected: virtual]
Reimplemented for internal reasons. Further reimplementations should call this function or else some features may not work correctly.
The API is unaffected.
void |
[protected: ]
Only called by konq_listviewwidget to select the current item after listing. For more information look in konquerorKeyPressEvent().
void |
[protected slots: slot]
Update internal settings whenever the global ones change.
void |
[protected slots: slot]
void |
[protected slots: slot]
void |
[protected slots: slot]
Repaint the rect where I was drawing the drop line.
void |
[protected slots: slot]
For future expansion.
Do not use.
void |
[protected slots: slot]
Emit the contextMenu signal. This slot is for mouse actions.
void |
[protected slots: slot]
Emit the contextMenu signal. This slot is for key presses.
void |
[protected slots: slot]
Accessory slot for AutoSelect
void |
[protected slots: slot]
Accessory slot for AutoSelect/ChangeCursorOverItem
void |
[protected slots: slot]
Process AutoSelection.
void |
[protected: ]
Handle dropEvent when itemsMovable() is set to true. ### for 3.0 : make this virtual
void |
[protected: ]
Where is the nearest QListViewItem that I'm going to drop? ### for 3.0 : make this virtual
void |
[protected: ]
A special keyPressEvent (for Konqueror-style selection).
int |
[protected: ]
Convert the depth of an item into its indentation in pixels