Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquicklabel_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
4#ifndef QQUICKLABEL_P_P_H
5#define QQUICKLABEL_P_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQml/private/qlazilyallocated_p.h>
19#include <QtQuick/private/qquicktext_p_p.h>
20#include <QtQuick/private/qquickitemchangelistener_p.h>
21#include <QtQuickTemplates2/private/qquickdeferredpointer_p_p.h>
22#include <QtQuickTemplates2/private/qquicktheme_p.h>
23
24#if QT_CONFIG(accessibility)
25#include <QtGui/qaccessible.h>
26#endif
27
29
31#if QT_CONFIG(accessibility)
32 , public QAccessible::ActivationObserver
33#endif
34{
35public:
36 Q_DECLARE_PUBLIC(QQuickLabel)
37
40
42 {
43 return static_cast<QQuickLabelPrivate *>(QObjectPrivate::get(item));
44 }
45
46 inline QMarginsF getInset() const { return QMarginsF(getLeftInset(), getTopInset(), getRightInset(), getBottomInset()); }
47 inline qreal getTopInset() const { return extra.isAllocated() ? extra->topInset : 0; }
48 inline qreal getLeftInset() const { return extra.isAllocated() ? extra->leftInset : 0; }
49 inline qreal getRightInset() const { return extra.isAllocated() ? extra->rightInset : 0; }
50 inline qreal getBottomInset() const { return extra.isAllocated() ? extra->bottomInset : 0; }
51
52 void setTopInset(qreal value, bool reset = false);
53 void setLeftInset(qreal value, bool reset = false);
54 void setRightInset(qreal value, bool reset = false);
55 void setBottomInset(qreal value, bool reset = false);
56
57 void resizeBackground();
58
59 void resolveFont();
60 void inheritFont(const QFont &font);
61 void updateFont(const QFont &font);
62 inline void setFont_helper(const QFont &font) {
63 if (sourceFont.resolveMask() == font.resolveMask() && sourceFont == font)
64 return;
65 updateFont(font);
66 }
67
68 void textChanged(const QString &text);
69
70#if QT_CONFIG(accessibility)
71 void accessibilityActiveChanged(bool active) override;
72 QAccessible::Role accessibleRole() const override;
73 void maybeSetAccessibleName(const QString &name);
74#endif
75
76 void cancelBackground();
77 void executeBackground(bool complete = false);
78
79 void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override;
82 void itemDestroyed(QQuickItem *item) override;
83
84 QPalette defaultPalette() const override;
85
86 struct ExtraData {
87 bool hasTopInset = false;
88 bool hasLeftInset = false;
89 bool hasRightInset = false;
90 bool hasBottomInset = false;
91 bool hasBackgroundWidth = false;
92 bool hasBackgroundHeight = false;
93 qreal topInset = 0;
94 qreal leftInset = 0;
95 qreal rightInset = 0;
96 qreal bottomInset = 0;
98 };
99 QLazilyAllocated<ExtraData> extra;
100
101 bool resizingBackground = false;
103 QQuickDeferredPointer<QQuickItem> background;
104};
105
107
108#endif // QQUICKLABEL_P_P_H
\reentrant
Definition qfont.h:22
uint resolveMask() const
Definition qfont.h:312
\inmodule QtCore
Definition qmargins.h:270
static QObjectPrivate * get(QObject *o)
Definition qobject_p.h:150
The QPalette class contains color groups for each widget state.
Definition qpalette.h:19
virtual void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &)
virtual void itemImplicitWidthChanged(QQuickItem *)
virtual void itemDestroyed(QQuickItem *)
virtual void itemImplicitHeightChanged(QQuickItem *)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
QMarginsF getInset() const
qreal getLeftInset() const
static QQuickLabelPrivate * get(QQuickLabel *item)
qreal getBottomInset() const
void setFont_helper(const QFont &font)
qreal getTopInset() const
qreal getRightInset() const
QLazilyAllocated< ExtraData > extra
QQuickDeferredPointer< QQuickItem > background
\inmodule QtCore\reentrant
Definition qrect.h:484
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QString text
void textChanged(const QString &newText)
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLuint name
GLboolean reset
#define Q_AUTOTEST_EXPORT
double qreal
Definition qtypes.h:187
QGraphicsItem * item