diff options
| author | Peter Penz <[email protected]> | 2012-02-23 17:26:51 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-02-23 17:28:03 +0100 |
| commit | 21a5a890b3010e591e139724d5c6f555df4481f9 (patch) | |
| tree | fb48c65173c9163cdf81c2bc8bc064af3ac0eff3 /src/kitemviews/kitemlistviewlayouter_p.h | |
| parent | a6627b9f2345eac9cc650aa9f87f9c69db8c707f (diff) | |
Whitespace cleanups and documentation fixes
Diffstat (limited to 'src/kitemviews/kitemlistviewlayouter_p.h')
| -rw-r--r-- | src/kitemviews/kitemlistviewlayouter_p.h | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/src/kitemviews/kitemlistviewlayouter_p.h b/src/kitemviews/kitemlistviewlayouter_p.h index 0d7c0d040..da5bd1d7d 100644 --- a/src/kitemviews/kitemlistviewlayouter_p.h +++ b/src/kitemviews/kitemlistviewlayouter_p.h @@ -30,6 +30,20 @@ class KItemModelBase; class KItemListSizeHintResolver; +/** + * @brief Internal helper class for KItemListView to layout the items. + * + * The layouter is capable to align the items within a grid. If the + * scroll-direction is horizontal the column-width of the grid can be + * variable. If the scroll-direction is vertical the row-height of + * the grid can be variable. + * + * The layouter is implemented in a way that it postpones the expensive + * layout operation until a property is read the first time after + * marking the layouter as dirty (see markAsDirty()). This means that + * changing properties of the layouter is not expensive, only the + * first read of a property can get expensive. + */ class LIBDOLPHINPRIVATE_EXPORT KItemListViewLayouter : public QObject { Q_OBJECT @@ -52,7 +66,7 @@ public: */ void setItemMargin(const QSizeF& margin); QSizeF itemMargin() const; - + /** * Sets the height of the header that is always aligned * at the top. A height of <= 0.0 means that no header is @@ -74,7 +88,7 @@ public: */ void setGroupHeaderMargin(qreal margin); qreal groupHeaderMargin() const; - + void setScrollOffset(qreal scrollOffset); qreal scrollOffset() const; @@ -111,14 +125,21 @@ public: */ QRectF itemRect(int index) const; + /** + * @return Rectangle of the group header for the item with the + * index \a index. Note that the layouter does not check + * whether the item really has a header: Usually only + * the first item of a group gets a header (see + * isFirstGroupItem()). + */ QRectF groupHeaderRect(int index) const; - + /** * @return Column of the item with the index \a index. * -1 is returned if an invalid index is given. */ int itemColumn(int index) const; - + /** * @return Row of the item with the index \a index. * -1 is returned if an invalid index is given. @@ -137,6 +158,10 @@ public: */ bool isFirstGroupItem(int itemIndex) const; + /** + * Marks the layouter as dirty. This means as soon as a property of + * the layouter gets read, an expensive relayout will be done. + */ void markAsDirty(); #ifndef QT_NO_DEBUG @@ -172,7 +197,7 @@ private: QSizeF m_itemSize; QSizeF m_itemMargin; - qreal m_headerHeight; + qreal m_headerHeight; const KItemModelBase* m_model; const KItemListSizeHintResolver* m_sizeHintResolver; |
