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
qquicktextfield_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 QQUICKTEXTFIELD_P_P_H
6#define QQUICKTEXTFIELD_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 <QtQml/private/qlazilyallocated_p.h>
20#include <QtQuick/private/qquicktextinput_p_p.h>
21#include <QtQuick/private/qquickitemchangelistener_p.h>
22#include <QtQuickTemplates2/private/qquickpresshandler_p_p.h>
23#include <QtQuickTemplates2/private/qquickdeferredpointer_p_p.h>
24#include <QtQuickTemplates2/private/qquicktheme_p.h>
25
26#include <QtQuickTemplates2/private/qquicktextfield_p.h>
27
28#if QT_CONFIG(accessibility)
29#include <QtGui/qaccessible.h>
30#endif
31
33
35#if QT_CONFIG(accessibility)
37#endif
38{
39public:
40 Q_DECLARE_PUBLIC(QQuickTextField)
41
44
45 static QQuickTextFieldPrivate *get(QQuickTextField *item) {
46 return static_cast<QQuickTextFieldPrivate *>(QObjectPrivate::get(item)); }
47
48 inline QMarginsF getInset() const { return QMarginsF(getLeftInset(), getTopInset(), getRightInset(), getBottomInset()); }
49 inline qreal getTopInset() const { return extra.isAllocated() ? extra->topInset : 0; }
50 inline qreal getLeftInset() const { return extra.isAllocated() ? extra->leftInset : 0; }
51 inline qreal getRightInset() const { return extra.isAllocated() ? extra->rightInset : 0; }
52 inline qreal getBottomInset() const { return extra.isAllocated() ? extra->bottomInset : 0; }
53
54 void setTopInset(qreal value, bool reset = false);
55 void setLeftInset(qreal value, bool reset = false);
56 void setRightInset(qreal value, bool reset = false);
57 void setBottomInset(qreal value, bool reset = false);
58
59 void resizeBackground();
60
61 void resolveFont();
62 void inheritFont(const QFont &font);
63 void updateFont(const QFont &font);
64 inline void setFont_helper(const QFont &font) {
65 if (sourceFont.resolveMask() == font.resolveMask() && sourceFont == font)
66 return;
67 updateFont(font);
68 }
69
70#if QT_CONFIG(quicktemplates2_hover)
71 void updateHoverEnabled(bool h, bool e);
72#endif
73
74 qreal getImplicitWidth() const override;
75 qreal getImplicitHeight() const override;
76
79
80 void readOnlyChanged(bool isReadOnly);
81 void echoModeChanged(QQuickTextField::EchoMode echoMode);
82
83#if QT_CONFIG(accessibility)
86#endif
87
88 void cancelBackground();
89 void executeBackground(bool complete = false);
90
91 void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override;
92 void itemImplicitWidthChanged(QQuickItem *item) override;
93 void itemImplicitHeightChanged(QQuickItem *item) override;
94 void itemDestroyed(QQuickItem *item) override;
95
96 QPalette defaultPalette() const override;
97
98 bool setLastFocusChangeReason(Qt::FocusReason reason) override;
99
100#if QT_CONFIG(quicktemplates2_hover)
101 bool hovered = false;
102 bool explicitHoverEnabled = false;
103#endif
104
119
120 bool resizingBackground = false;
125};
126
127QT_END_NAMESPACE
128
129#endif // QQUICKTEXTFIELD_P_P_H
void readOnlyChanged(bool isReadOnly)
void implicitWidthChanged() override
qreal getImplicitWidth() const override
bool setLastFocusChangeReason(Qt::FocusReason reason) override
void setFont_helper(const QFont &font)
QQuickFlickable * flickable
QQuickDeferredPointer< QQuickItem > background
void setTopInset(qreal value, bool reset=false)
void setLeftInset(qreal value, bool reset=false)
void setRightInset(qreal value, bool reset=false)
void executeBackground(bool complete=false)
QLazilyAllocated< ExtraData > extra
void updateFont(const QFont &font)
void setBottomInset(qreal value, bool reset=false)
void itemDestroyed(QQuickItem *item) override
void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override
void itemImplicitWidthChanged(QQuickItem *item) override
void attachFlickable(QQuickFlickable *flickable)
void inheritFont(const QFont &font)
qreal getImplicitHeight() const override
QQuickPressHandler pressHandler
void itemImplicitHeightChanged(QQuickItem *item) override
QMarginsF getInset() const
static QQuickTextAreaPrivate * get(QQuickTextArea *item)
QPalette defaultPalette() const override
void implicitHeightChanged() override
void executeBackground(bool complete=false)
static QQuickTextFieldPrivate * get(QQuickTextField *item)
void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override
void echoModeChanged(QQuickTextField::EchoMode echoMode)
qreal getImplicitHeight() const override
void setBottomInset(qreal value, bool reset=false)
void inheritFont(const QFont &font)
QQuickDeferredPointer< QQuickItem > background
void setRightInset(qreal value, bool reset=false)
void itemImplicitWidthChanged(QQuickItem *item) override
void readOnlyChanged(bool isReadOnly)
void itemImplicitHeightChanged(QQuickItem *item) override
void setLeftInset(qreal value, bool reset=false)
qreal getImplicitWidth() const override
void setFont_helper(const QFont &font)
void implicitHeightChanged() override
void setTopInset(qreal value, bool reset=false)
void itemDestroyed(QQuickItem *item) override
QQuickPressHandler pressHandler
void implicitWidthChanged() override
QLazilyAllocated< ExtraData > extra
void updateFont(const QFont &font)
QPalette defaultPalette() const override
bool setLastFocusChangeReason(Qt::FocusReason reason) override
static bool isKeyFocusReason(Qt::FocusReason reason)
static QString contentItemName()