]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistheader_p.h
Remember sort settings
[dolphin.git] / src / kitemviews / kitemlistheader_p.h
index 43b7db59a909f5bccfdc186a161dab0a2bd52d00..41505585ee2b4c9003d03aa4c42938820013e748 100644 (file)
@@ -47,6 +47,8 @@ public:
     void setVisibleRolesWidths(const QHash<QByteArray, qreal> rolesWidths);
     QHash<QByteArray, qreal> visibleRolesWidths() const;
 
+    qreal minimumRoleWidth() const;
+
     virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
 
 signals:
@@ -58,6 +60,22 @@ signals:
                                  qreal currentWidth,
                                  qreal previousWidth);
 
+    /**
+     * Is emitted if the user has changed the sort order by clicking on a
+     * header item. The sort order of the model has already been adjusted to
+     * the current sort order. Note that no signal will be emitted if the
+     * sort order of the model has been changed without user interaction.
+     */
+    void sortOrderChanged(Qt::SortOrder current, Qt::SortOrder previous);
+
+    /**
+     * Is emitted if the user has changed the sort role by clicking on a
+     * header item. The sort role of the model has already been adjusted to
+     * the current sort role. Note that no signal will be emitted if the
+     * sort role of the model has been changed without user interaction.
+     */
+    void sortRoleChanged(const QByteArray& current, const QByteArray& previous);
+
 protected:
     virtual void mousePressEvent(QGraphicsSceneMouseEvent* event);
     virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* event);
@@ -77,7 +95,6 @@ private:
     void updateHoveredRoleIndex(const QPointF& pos);
     int roleIndexAt(const QPointF& pos) const;
     bool isAboveRoleGrip(const QPointF& pos, int roleIndex) const;
-    qreal minimumRoleWidth() const;
 
 private:
     enum RoleOperation