31 explicit DViewItemAction(Qt::Alignment alignment = Qt::Alignment(),
const QSize &iconSize = QSize(),
32 const QSize &maxSize = QSize(),
bool clickable =
false);
33#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
34 D_DECL_DEPRECATED
explicit DViewItemAction(Qt::Alignment alignment,
const QSize &iconSize,
35 const QSize &maxSize,
bool clickable, QObject *parent);
38 Qt::Alignment alignment()
const;
39 QSize iconSize()
const;
40 QSize maximumSize()
const;
42 QMargins clickAreaMargins()
const;
43 void setClickAreaMargins(
const QMargins &margins);
45 void setTextColorRole(DPalette::ColorType role);
46 void setTextColorRole(DPalette::ColorRole role);
47 DPalette::ColorType textColorType()
const;
48 DPalette::ColorRole textColorRole()
const;
50 void setFontSize(DFontSizeManager::SizeType size);
53 bool isClickable()
const;
55 void setWidget(QWidget *widget);
56 QWidget *widget()
const;
58 void setDciIcon(
const DDciIcon &dciIcon);
59 DDciIcon dciIcon()
const;
69 Q_PROPERTY(BackgroundType backgroundType READ backgroundType WRITE setBackgroundType)
70 Q_PROPERTY(QMargins margins READ margins WRITE setMargins)
71 Q_PROPERTY(QSize itemSize READ itemSize WRITE setItemSize)
76 ClipCornerBackground = 1,
77 RoundedBackground = 2,
78 BackgroundType_Mask = 0xff,
84 void paint(QPainter *painter,
const QStyleOptionViewItem &option,
const QModelIndex &index)
const override;
85 QSize sizeHint(
const QStyleOptionViewItem &option,
const QModelIndex &index)
const override;
87 void updateEditorGeometry(QWidget *editor,
88 const QStyleOptionViewItem &option,
89 const QModelIndex &index)
const override;
91 BackgroundType backgroundType()
const;
92 QMargins margins()
const;
93 QSize itemSize()
const;
97 void setBackgroundType(BackgroundType backgroundType);
98 void setMargins(
const QMargins margins);
99 void setItemSize(QSize itemSize);
100 void setItemSpacing(
int spacing);
103 void initStyleOption(QStyleOptionViewItem *option,
const QModelIndex &index)
const override;
104 bool eventFilter(QObject *
object, QEvent *event)
override;
110 using QStandardItem::QStandardItem;
113 void setActionList(Qt::Edge edge,
const DViewItemActionList &list);
114 DViewItemActionList actionList(Qt::Edge edge)
const;
116 void setTextActionList(
const DViewItemActionList &list);
117 DViewItemActionList textActionList()
const;
119 void setTextColorRole(DPalette::ColorType role);
120 void setTextColorRole(DPalette::ColorRole role);
121 DPalette::ColorType textColorType()
const;
122 DPalette::ColorRole textColorRole()
const;
124 void setBackgroundRole(DPalette::ColorType role);
125 void setBackgroundRole(DPalette::ColorRole role);
126 DPalette::ColorType backgroundType()
const;
127 DPalette::ColorRole backgroundRole()
const;
129 void setFontSize(DFontSizeManager::SizeType size);
132 void setDciIcon(
const DDciIcon &dciIcon);
133 DDciIcon dciIcon()
const;
135 virtual QStandardItem *clone()
const override;