diff options
| author | Peter Penz <[email protected]> | 2011-10-08 21:40:34 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-10-08 21:43:55 +0200 |
| commit | 6551c000fc68134932cdc21f2cc7086b34bff30b (patch) | |
| tree | f4892d247c13f988ee68de37ea1700aaf6e80ab2 /src/kitemviews/kitemlistcontroller.h | |
| parent | b1b5a6db2e8b9b1fc175d068ba393925d95c9dc6 (diff) | |
Context menu cleanups
- Open the context menu on the mouse-press event, not on the
mouse-release event.
- Provide an explicit position-information and don't use
QCursor::pos(). This fixes the issue that opening a context-menu
by the keyboard opens below the cursor.
- Provide different signals in the KItemListController for
the different context-menu types (item vs. view vs. header).
- Implement turning on/off roles by the header-context-menu.
Diffstat (limited to 'src/kitemviews/kitemlistcontroller.h')
| -rw-r--r-- | src/kitemviews/kitemlistcontroller.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/kitemviews/kitemlistcontroller.h b/src/kitemviews/kitemlistcontroller.h index 8ef045ea3..d6205ea0a 100644 --- a/src/kitemviews/kitemlistcontroller.h +++ b/src/kitemviews/kitemlistcontroller.h @@ -108,7 +108,22 @@ public: signals: void itemActivated(int index); void itemMiddleClicked(int index); - void contextMenuRequested(int index, const QPointF& pos); + + /** + * Emitted if a context-menu is requested for the item with + * the index \a index. It is assured that the index is valid. + */ + void itemContextMenuRequested(int index, const QPointF& pos); + + /** + * Emitted if a context-menu is requested for the KItemListView. + */ + void viewContextMenuRequested(const QPointF& pos); + + /** + * Emitted if a context-menu is requested for the header of the KItemListView. + */ + void headerContextMenuRequested(const QPointF& pos); /** * Is emitted if the item with the index \p index gets hovered. |
