Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickiconlabel_p_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QQUICKICONLABEL_P_P_H
6#define QQUICKICONLABEL_P_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtQuick/private/qquickitem_p.h>
20#include <QtQuickControls2Impl/private/qtquickcontrols2implglobal_p.h>
21#include <QtQuickControls2Impl/private/qquickiconlabel_p.h>
22
24
25class QQuickIconImage;
26class QQuickMnemonicLabel;
27
28class Q_AUTOTEST_EXPORT QQuickIconLabelPrivate : public QQuickItemPrivate,
29 public QSafeQuickItemChangeListener<QQuickIconLabelPrivate>
30{
31 Q_DECLARE_PUBLIC(QQuickIconLabel)
32
33public:
34 ~QQuickIconLabelPrivate() override;
35
36 bool hasIcon() const;
37 bool hasText() const;
38
39 bool createImage();
40 bool destroyImage();
41 bool updateImage();
42 void syncImage();
43 void updateOrSyncImage();
44
45 bool createLabel();
46 bool destroyLabel();
47 bool updateLabel();
48 void syncLabel();
49 void updateOrSyncLabel();
50
51 void updateImplicitSize();
52 void layout();
53
54 void watchChanges(QQuickItem *item);
55 void unwatchChanges(QQuickItem *item);
56 void setPositioningDirty();
57
58 bool isLeftToRight() const;
59
60 void itemImplicitWidthChanged(QQuickItem *) override;
61 void itemImplicitHeightChanged(QQuickItem *) override;
62 void itemDestroyed(QQuickItem *item) override;
63
64 bool mirrored = false;
65 QQuickIconLabel::Display display = QQuickIconLabel::TextBesideIcon;
66 Qt::Alignment alignment = Qt::AlignCenter;
67 qreal spacing = 0;
68 qreal topPadding = 0;
69 qreal leftPadding = 0;
70 qreal rightPadding = 0;
71 qreal bottomPadding = 0;
72 QFont font;
73 QColor color;
74 QString text;
75 QQuickIcon icon;
76 QQuickIconImage *image = nullptr;
77 QQuickMnemonicLabel *label = nullptr;
78};
79
80QT_END_NAMESPACE
81
82#endif // QQUICKICONLABEL_P_P_H
static void completeComponent(QQuickItem *item)
static const QQuickItemPrivate::ChangeTypes itemChangeTypes
static QT_BEGIN_NAMESPACE void beginClass(QQuickItem *item)
static QRectF alignedRect(bool mirrored, Qt::Alignment alignment, const QSizeF &size, const QRectF &rectangle)