]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistcontainer.h
Prepare view-engine for non-KFileItem usecase
[dolphin.git] / src / kitemviews / kitemlistcontainer.h
index 4d6eadbbbd4356a6f3671e38cf2e9a031a5d7faa..474a9ecc03d3528c4208ff73bf2eff564970e3c7 100644 (file)
@@ -37,6 +37,8 @@ class QPropertyAnimation;
 /**
  * @brief Provides a QWidget based scrolling view for a KItemListController.
  *
+ * The model and view are maintained by the KItemListController.
+ *
  * @see KItemListController
  */
 class LIBDOLPHINPRIVATE_EXPORT KItemListContainer : public QAbstractScrollArea
@@ -44,12 +46,19 @@ class LIBDOLPHINPRIVATE_EXPORT KItemListContainer : public QAbstractScrollArea
     Q_OBJECT
 
 public:
+    /**
+     * @param controller Controller that maintains the model and the view.
+     *                   The KItemListContainer takes ownership of the controller
+     *                   (the parent will be set to the KItemListContainer).
+     * @param parent     Optional parent widget.
+     */
     explicit KItemListContainer(KItemListController* controller, QWidget* parent = 0);
-    KItemListContainer(QWidget* parent = 0);
     virtual ~KItemListContainer();
-
     KItemListController* controller() const;
 
+    void setEnabledFrame(bool enable);
+    bool enabledFrame() const;
+
 protected:
     virtual void keyPressEvent(QKeyEvent* event);
     virtual void showEvent(QShowEvent* event);
@@ -66,10 +75,16 @@ private slots:
     void updateItemOffsetScrollBar();
 
 private:
-    void initialize();
     void updateGeometries();
     void updateSmoothScrollers(Qt::Orientation orientation);
 
+    /**
+     * Helper method for updateScrollOffsetScrollBar(). Updates the scrollbar-policy
+     * to Qt::ScrollBarAlwaysOn for cases where turning off the scrollbar might lead
+     * to an endless layout loop (see bug #293318).
+     */
+    void updateScrollOffsetScrollBarPolicy();
+
 private:
     KItemListController* m_controller;