DtkDeclarative
DTK Declarative module
载入中...
搜索中...
未找到
dquickiconlabel_p_p.h
1// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DQUICKICONLABEL_P_P_H
6#define DQUICKICONLABEL_P_P_H
7
8#include "dquickiconlabel_p.h"
9
10#include <private/qquickitem_p.h>
11
12DQUICK_BEGIN_NAMESPACE
13
14class DQuickIconLabelPrivate : public QQuickItemPrivate, public QQuickItemChangeListener
15{
16 Q_DECLARE_PUBLIC(DQuickIconLabel)
17
18public:
19 bool hasIcon() const;
20 bool hasText() const;
21
22 void createIconImage();
23 bool ensureImage();
24 bool destroyImage();
25 bool updateImage();
26 void syncImage();
27 void updateOrSyncImage();
28
29 bool createLabel();
30 bool destroyLabel();
31 bool updateLabel();
32 void syncLabel();
33 void updateOrSyncLabel();
34
35 void updateImplicitSize();
36 void layout();
37
38 void watchChanges(QQuickItem *item);
39 void unwatchChanges(QQuickItem *item);
40 void setPositioningDirty();
41
42 bool isLeftToRight() const;
43
44 void itemImplicitWidthChanged(QQuickItem *) override;
45 void itemImplicitHeightChanged(QQuickItem *) override;
46 void itemDestroyed(QQuickItem *item) override;
47
48 QSize iconSize() const;
49
50 bool mirrored = false;
51 DQuickIconLabel::Display display = DQuickIconLabel::TextBesideIcon;
52 Qt::Alignment alignment = Qt::AlignCenter;
53 qreal spacing = 0;
54 qreal topPadding = 0;
55 qreal leftPadding = 0;
56 qreal rightPadding = 0;
57 qreal bottomPadding = 0;
58 QFont font;
59 QColor color;
60 QString text;
61 DQuickDciIconImage *image = nullptr;
62 QQuickText *label = nullptr;
63 DQuickDciIcon icon;
64};
65
66DQUICK_END_NAMESPACE
67
68#endif // DQUICKICONLABEL_P_P_H
Definition dquickdciiconimage_p.h:23
A dci icon type for qml.
Definition dquickdciicon_p.h:23
Definition dquickiconlabel_p_p.h:15
Definition dquickiconlabel_p.h:19