8#include <dtkwidget_global.h>
12#include <QStyleOption>
25 MarginsRole = Qt::UserRole + 1,
31 ViewItemFontLevelRole,
32 ViewItemBackgroundRole,
33 ViewItemForegroundRole,
34 ViewItemShowToolTipRole,
35 UserRole = Qt::UserRole << 2
40DWIDGET_BEGIN_NAMESPACE
46 SO_HighlightButton = QStyleOption::SO_CustomBase + 1,
47 SO_CustomBase = QStyleOption::SO_CustomBase << 2
50 virtual void init(QWidget *widget);
51 virtual void init(
const QWidget *widget);
64 SuggestButton = (CommandLinkButton << 1),
65 WarningButton = (SuggestButton << 1),
66 FloatingButton = (WarningButton << 1),
67 TitleBarButton = (FloatingButton << 1),
68 CircleButton = (TitleBarButton << 1),
69 HasDciIcon = (CircleButton << 1)
72 void init(
const QWidget *widget)
override;
87 Qt::Orientation orientation;
88 ButtonPosition position;
94 enum LineEditFeature {
99 Q_DECLARE_FLAGS(LineEditFeatures, LineEditFeature)
101 void init(
const QWidget *widget)
override;
103 LineEditFeatures features = None;
104 QRect iconButtonRect;
110 enum ItemBackgroundPosition {
118 using DStyleOption::DStyleOption;
119 using QStyleOption::QStyleOption;
120 void init(
const QWidget *widget)
override;
122 Qt::Orientations directions;
123 ItemBackgroundPosition position;
137 enum IconType { SI_QIcon, SI_DciIcon };
141 Qt::Alignment iconAlignment;
144 DDciIcon::Theme dciTheme;
145 DDciIcon::Mode dciMode;
151 enum ViewItemFeature {
159 using DStyleOption::init;
161 int frameRadius = -1;
184 void bind(QWidget *widget, SizeType type);
185 void bind(QWidget *widget, SizeType type,
int weight);
186 void unbind(QWidget *widget);
188 quint16 fontPixelSize(SizeType type)
const;
189 void setFontPixelSize(SizeType type, quint16 size);
190 void setFontGenericPixelSize(quint16 size);
191 const QFont get(SizeType type,
const QFont &base = QFont())
const;
192 const QFont get(SizeType type,
int weight,
const QFont &base = QFont())
const;
194 inline const QFont t1(
const QFont &base = QFont())
const
195 {
return get(T1, base); }
196 inline const QFont t2(
const QFont &base = QFont())
const
197 {
return get(T2, base); }
198 inline const QFont t3(
const QFont &base = QFont())
const
199 {
return get(T3, base); }
200 inline const QFont t4(
const QFont &base = QFont())
const
201 {
return get(T4, base); }
202 inline const QFont t5(
const QFont &base = QFont())
const
203 {
return get(T5, base); }
204 inline const QFont t6(
const QFont &base = QFont())
const
205 {
return get(T6, base); }
206 inline const QFont t7(
const QFont &base = QFont())
const
207 {
return get(T7, base); }
208 inline const QFont t8(
const QFont &base = QFont())
const
209 {
return get(T8, base); }
210 inline const QFont t9(
const QFont &base = QFont())
const
211 {
return get(T9, base); }
212 inline const QFont t10(
const QFont &base = QFont())
const
213 {
return get(T10, base); }
214 inline const QFont t11(
const QFont &base = QFont())
const
215 {
return get(T11, base); }
217 static int fontPixelSize(
const QFont &font);
222 QScopedPointer<DFontSizeManagerPrivate> d;