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
29
31{
32public:
33 Q_DECLARE_PUBLIC(QQuickTextField)
34
37
38 static QQuickTextFieldPrivate *get(QQuickTextField *item) {
39 return static_cast<QQuickTextFieldPrivate *>(QObjectPrivate::get(item)); }
40
41 inline QMarginsF getInset() const { return QMarginsF(getLeftInset(), getTopInset(), getRightInset(), getBottomInset()); }
42 inline qreal getTopInset() const { return extra.isAllocated() ? extra->topInset : 0; }
43 inline qreal getLeftInset() const { return extra.isAllocated() ? extra->leftInset : 0; }
44 inline qreal getRightInset() const { return extra.isAllocated() ? extra->rightInset : 0; }
45 inline qreal getBottomInset() const { return extra.isAllocated() ? extra->bottomInset : 0; }
46
47 void setTopInset(qreal value, bool reset = false);
48 void setLeftInset(qreal value, bool reset = false);
49 void setRightInset(qreal value, bool reset = false);
50 void setBottomInset(qreal value, bool reset = false);
51
52 void resizeBackground();
53
54 void resolveFont();
55 void inheritFont(const QFont &font);
56 void updateFont(const QFont &font);
57 inline void setFont_helper(const QFont &font) {
58 if (sourceFont.resolveMask() == font.resolveMask() && sourceFont == font)
59 return;
60 updateFont(font);
61 }
62
63#if QT_CONFIG(quicktemplates2_hover)
64 void updateHoverEnabled(bool h, bool e);
65#endif
66
67 qreal getImplicitWidth() const override;
68 qreal getImplicitHeight() const override;
69
72
73 virtual void readOnlyChanged(bool isReadOnly) override;
74
75#if QT_CONFIG(accessibility)
77#endif
78
79 void cancelBackground();
80 void executeBackground(bool complete = false);
81
82 void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override;
83 void itemImplicitWidthChanged(QQuickItem *item) override;
84 void itemImplicitHeightChanged(QQuickItem *item) override;
85 void itemDestroyed(QQuickItem *item) override;
86
87 QPalette defaultPalette() const override;
88
89 bool setLastFocusChangeReason(Qt::FocusReason reason) override;
90
91#if QT_CONFIG(quicktemplates2_hover)
92 bool hovered = false;
93 bool explicitHoverEnabled = false;
94#endif
95
110
111 bool resizingBackground = false;
116};
117
118QT_END_NAMESPACE
119
120#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
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
virtual void readOnlyChanged(bool isReadOnly) override
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
Combined button and popup list for selecting options.
static bool isKeyFocusReason(Qt::FocusReason reason)
static QString contentItemName()