summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qlistview.h
diff options
context:
space:
mode:
authorAlexander Volkov <a.volkov@rusbitech.ru>2016-10-18 16:35:16 +0300
committerAlexander Volkov <a.volkov@rusbitech.ru>2017-01-12 17:54:52 +0000
commita4c25c020554527aa9ff9b533afabffef46be131 (patch)
tree343109f81aa8eec74eba69700a3e842b6551c7e9 /src/widgets/itemviews/qlistview.h
parentdcec1420ea9d7e90bbd7f37be15d8e61eaf35d23 (diff)
Add expandingListItems property to QListView
This property allows to change the default behavior in which list items occupy the entire width of the column. Setting it to false will reduce their widths to the minimum values, thus allowing to have intermediate free space. Then the user will be able to begin selections by mouse from this space. [ChangeLog][QtWidgets][QListView] Added expandingListItems property. Change-Id: I6bd1b147fd0335324310a165104c36f6b0d6ac9f Task-number: QTBUG-56606 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Diffstat (limited to 'src/widgets/itemviews/qlistview.h')
-rw-r--r--src/widgets/itemviews/qlistview.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/widgets/itemviews/qlistview.h b/src/widgets/itemviews/qlistview.h
index e918e66d38..4cf53f9bab 100644
--- a/src/widgets/itemviews/qlistview.h
+++ b/src/widgets/itemviews/qlistview.h
@@ -66,6 +66,7 @@ class Q_WIDGETS_EXPORT QListView : public QAbstractItemView
Q_PROPERTY(int batchSize READ batchSize WRITE setBatchSize)
Q_PROPERTY(bool wordWrap READ wordWrap WRITE setWordWrap)
Q_PROPERTY(bool selectionRectVisible READ isSelectionRectVisible WRITE setSelectionRectVisible)
+ Q_PROPERTY(bool expandingListItems READ isExpandingListItems WRITE setExpandingListItems)
public:
enum Movement { Static, Free, Snap };
@@ -126,6 +127,9 @@ public:
void setSelectionRectVisible(bool show);
bool isSelectionRectVisible() const;
+ void setExpandingListItems(bool enable);
+ bool isExpandingListItems() const;
+
QRect visualRect(const QModelIndex &index) const Q_DECL_OVERRIDE;
void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) Q_DECL_OVERRIDE;
QModelIndex indexAt(const QPoint &p) const Q_DECL_OVERRIDE;