34class LIBDTKWIDGETSHARED_EXPORT
DListView :
public QListView,
public DTK_CORE_NAMESPACE::DObject
39 Q_PROPERTY(
int count READ count NOTIFY rowCountChanged)
41 Q_PROPERTY(Qt::Orientation orientation READ orientation NOTIFY orientationChanged)
42 Q_PROPERTY(
DStyledItemDelegate::BackgroundType backgroundType READ backgroundType WRITE setBackgroundType)
43 Q_PROPERTY(QMargins itemMargins READ itemMargins WRITE setItemMargins)
44 Q_PROPERTY(QSize itemSize READ itemSize WRITE setItemSize)
51 QWidget *getHeaderWidget(
int index) const;
52 QWidget *getFooterWidget(
int index) const;
55 bool isActiveRect(const QRect &rect) const;
56 bool isVisualRect(const QRect &rect) const;
60 Qt::Orientation orientation() const;
62 void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE;
63 QSize minimumSizeHint() const Q_DECL_OVERRIDE;
66 QMargins itemMargins() const;
67 QSize itemSize() const;
69 using QListView::contentsSize;
70 using QListView::setViewportMargins;
73 bool addItem(const QVariant &data);
74 bool addItems(const QVariantList &datas);
75 bool insertItem(
int index, const QVariant &data);
76 bool insertItems(
int index, const QVariantList &datas);
77 bool removeItem(
int index);
78 bool removeItems(
int index,
int count);
80 int addHeaderWidget(QWidget *widget);
81 void removeHeaderWidget(
int index);
82 QWidget *takeHeaderWidget(
int index);
83 int addFooterWidget(QWidget *widget);
84 void removeFooterWidget(
int index);
85 QWidget *takeFooterWidget(
int index);
87 void setOrientation(QListView::Flow flow,
bool wrapping);
88 void edit(const QModelIndex &index);
91 void setItemMargins(const QMargins &itemMargins);
92 void setItemSize(QSize itemSize);
93 void setItemSpacing(
int spacing);
94 void setItemRadius(
int radius);
97 void rowCountChanged();
98 void orientationChanged(Qt::Orientation orientation);
99 void currentChanged(const QModelIndex &previous);
100 void triggerEdit(const QModelIndex &index);
103#if(QT_VERSION < 0x050500)
104 void setViewportMargins(
int left,
int top,
int right,
int bottom);
105 void setViewportMargins(
const QMargins &margins);
106 QMargins viewportMargins()
const;
109 void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
110 void currentChanged(
const QModelIndex ¤t,
const QModelIndex &previous) Q_DECL_OVERRIDE;
111 bool edit(
const QModelIndex &index, EditTrigger trigger, QEvent *event) Q_DECL_OVERRIDE;
113#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
114 QStyleOptionViewItem viewOptions()
const override;
116 void initViewItemOption(QStyleOptionViewItem *option)
const override;
118 virtual QModelIndex moveCursor(CursorAction cursorAction,
119 Qt::KeyboardModifiers modifiers)
override;
120 QSize viewportSizeHint()
const override;
121 int horizontalOffset()
const override;
124 void setFlow(QListView::Flow flow);
125 void setWrapping(
bool enable);