From 6551c000fc68134932cdc21f2cc7086b34bff30b Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 8 Oct 2011 21:40:34 +0200 Subject: 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. --- src/kitemviews/kitemlistview.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/kitemviews/kitemlistview.h') diff --git a/src/kitemviews/kitemlistview.h b/src/kitemviews/kitemlistview.h index 47de53e20..e1678145d 100644 --- a/src/kitemviews/kitemlistview.h +++ b/src/kitemviews/kitemlistview.h @@ -180,6 +180,13 @@ public: void endTransaction(); bool isTransactionActive() const; + /** + * Turns on the header if \p show is true. Per default the + * header is not shown. + */ + void setHeaderShown(bool show); + bool isHeaderShown() const; + /** * @return Pixmap that is used for a drag operation based on the * items given by \a indexes. The default implementation returns @@ -346,12 +353,6 @@ private: */ void updateStretchedVisibleRolesSizes(); - /** - * Turns on the header if \p show is true. Per default the - * header is not shown. - */ - void setHeaderShown(bool show); - /** * @return Sum of the widths of all visible roles. */ @@ -362,6 +363,12 @@ private: */ qreal visibleRolesSizesHeightSum() const; + /** + * @return Boundaries of the header. An empty rectangle is returned + * if no header is shown. + */ + QRectF headerBoundaries() const; + /** * Helper function for triggerAutoScrolling(). * @param pos Logical position of the mouse relative to the range. -- cgit v1.3.1