diff options
| author | Nicolas Fella <[email protected]> | 2023-10-24 23:12:22 +0200 |
|---|---|---|
| committer | Nicolas Fella <[email protected]> | 2023-10-24 23:14:25 +0200 |
| commit | 1826f905d706925456763394de17294bcb6d1c35 (patch) | |
| tree | 6838f9f0a8423cc7b0b86554139299c649f53b42 /src/kitemviews/kitemlistview.h | |
| parent | 8b91acf05b2b41ae68268081d31af18cf66d3bca (diff) | |
| parent | ef59e42c40df5e873a1a1b6c2173d5b55641a783 (diff) | |
Merge branch 'master' into kf6
Diffstat (limited to 'src/kitemviews/kitemlistview.h')
| -rw-r--r-- | src/kitemviews/kitemlistview.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/kitemviews/kitemlistview.h b/src/kitemviews/kitemlistview.h index 7bcaec704..8812eb8cc 100644 --- a/src/kitemviews/kitemlistview.h +++ b/src/kitemviews/kitemlistview.h @@ -59,6 +59,9 @@ class DOLPHIN_EXPORT KItemListView : public QGraphicsWidget Q_PROPERTY(qreal itemOffset READ itemOffset WRITE setItemOffset NOTIFY itemOffsetChanged) public: + /** The position in the view to which an item should be scrolled to. */ + enum ViewItemPosition { Beginning, Middle, End, Nearest }; + explicit KItemListView(QGraphicsWidget *parent = nullptr); ~KItemListView() override; @@ -251,9 +254,10 @@ public: /** * Scrolls to the item with the index \a index so that the item - * will be fully visible. + * will be fully visible. The item is positioned within the view + * as specified by \a viewItemPosition. */ - void scrollToItem(int index); + void scrollToItem(int index, ViewItemPosition viewItemPosition = ViewItemPosition::Nearest); /** * If several properties of KItemListView are changed synchronously, it is |
