]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistview.h
Allow resizing of columns by the user
[dolphin.git] / src / kitemviews / kitemlistview.h
index da02e0bc232c7b5c5e50e6777e6423d0f3857d37..b088ea4873ca0f2271a5e053c24c37a103c774b7 100644 (file)
@@ -147,6 +147,12 @@ public:
     int lastVisibleIndex() const;
 
     virtual QSizeF itemSizeHint(int index) const;
+
+    /**
+     * @return The size of each visible role in case if KItemListView::itemSize()
+     *         is empty. This allows to have dynamic but equal role sizes between
+     *         all items. Per default an empty hash is returned.
+     */
     virtual QHash<QByteArray, QSizeF> visibleRoleSizes() const;
 
     /**
@@ -228,6 +234,16 @@ private slots:
     void slotRubberBandPosChanged();
     void slotRubberBandActivationChanged(bool active);
 
+    /**
+     * Is invoked if the visible role-width of one role in the header has
+     * been changed by the user. It is remembered that the user has modified
+     * the role-width, so that it won't be changed anymore automatically to
+     * calculate an optimized width.
+     */
+    void slotVisibleRoleWidthChanged(const QByteArray& role,
+                                     qreal currentWidth,
+                                     qreal previousWidth);
+
     /**
      * Triggers the autoscrolling if autoScroll() is enabled by checking the
      * current mouse position. If the mouse position is within the autoscroll
@@ -354,6 +370,7 @@ private:
     QTimer* m_autoScrollTimer;
 
     KItemListHeader* m_header;
+    bool m_useHeaderWidths;
 
     friend class KItemListController;
 };