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
qquicktextfield_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 QQUICKTEXTFIELD_P_H
5#define QQUICKTEXTFIELD_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 <QtGui/qpalette.h>
19#include <QtQuick/private/qquicktextinput_p.h>
20#include <QtQuick/private/qquickevents_p_p.h>
21#include <QtQuickTemplates2/private/qtquicktemplates2global_p.h>
22
24
26
27class Q_QUICKTEMPLATES2_EXPORT QQuickTextField : public QQuickTextInput
28{
30 Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged) // override
31 Q_PROPERTY(qreal implicitWidth READ implicitWidth WRITE setImplicitWidth NOTIFY implicitWidthChanged3 FINAL)
32 Q_PROPERTY(qreal implicitHeight READ implicitHeight WRITE setImplicitHeight NOTIFY implicitHeightChanged3 FINAL)
33 Q_PROPERTY(QQuickItem *background READ background WRITE setBackground NOTIFY backgroundChanged FINAL)
34 Q_PROPERTY(QString placeholderText READ placeholderText WRITE setPlaceholderText NOTIFY placeholderTextChanged FINAL)
35 Q_PROPERTY(Qt::FocusReason focusReason READ focusReason WRITE setFocusReason NOTIFY focusReasonChanged FINAL)
36 // 2.1 (Qt 5.8)
37 Q_PROPERTY(bool hovered READ isHovered NOTIFY hoveredChanged FINAL REVISION(2, 1))
38 Q_PROPERTY(bool hoverEnabled READ isHoverEnabled WRITE setHoverEnabled RESET resetHoverEnabled NOTIFY hoverEnabledChanged FINAL REVISION(2, 1))
39 // 2.5 (Qt 5.12)
40 Q_PROPERTY(QColor placeholderTextColor READ placeholderTextColor WRITE setPlaceholderTextColor NOTIFY placeholderTextColorChanged FINAL REVISION(2, 5))
41 Q_PROPERTY(qreal implicitBackgroundWidth READ implicitBackgroundWidth NOTIFY implicitBackgroundWidthChanged FINAL REVISION(2, 5))
42 Q_PROPERTY(qreal implicitBackgroundHeight READ implicitBackgroundHeight NOTIFY implicitBackgroundHeightChanged FINAL REVISION(2, 5))
43 Q_PROPERTY(qreal topInset READ topInset WRITE setTopInset RESET resetTopInset NOTIFY topInsetChanged FINAL REVISION(2, 5))
44 Q_PROPERTY(qreal leftInset READ leftInset WRITE setLeftInset RESET resetLeftInset NOTIFY leftInsetChanged FINAL REVISION(2, 5))
45 Q_PROPERTY(qreal rightInset READ rightInset WRITE setRightInset RESET resetRightInset NOTIFY rightInsetChanged FINAL REVISION(2, 5))
46 Q_PROPERTY(qreal bottomInset READ bottomInset WRITE setBottomInset RESET resetBottomInset NOTIFY bottomInsetChanged FINAL REVISION(2, 5))
47 Q_CLASSINFO("DeferredPropertyNames", "background")
48 QML_NAMED_ELEMENT(TextField)
50
51public:
52 explicit QQuickTextField(QQuickItem *parent = nullptr);
54
55 QFont font() const;
56 void setFont(const QFont &font);
57
58 QQuickItem *background() const;
59 void setBackground(QQuickItem *background);
60
61 QString placeholderText() const;
62 void setPlaceholderText(const QString &text);
63
64 Qt::FocusReason focusReason() const;
65 void setFocusReason(Qt::FocusReason reason);
66
67 // 2.1 (Qt 5.8)
68 bool isHovered() const;
69 void setHovered(bool hovered);
70
71 bool isHoverEnabled() const;
72 void setHoverEnabled(bool enabled);
73 void resetHoverEnabled();
74
75 // 2.5 (Qt 5.12)
76 QColor placeholderTextColor() const;
77 void setPlaceholderTextColor(const QColor &color);
78
79 qreal implicitBackgroundWidth() const;
80 qreal implicitBackgroundHeight() const;
81
82 qreal topInset() const;
83 void setTopInset(qreal inset);
84 void resetTopInset();
85
86 qreal leftInset() const;
87 void setLeftInset(qreal inset);
88 void resetLeftInset();
89
90 qreal rightInset() const;
91 void setRightInset(qreal inset);
92 void resetRightInset();
93
94 qreal bottomInset() const;
95 void setBottomInset(qreal inset);
96 void resetBottomInset();
97
99 void fontChanged();
100 void implicitWidthChanged3();
101 void implicitHeightChanged3();
102 void backgroundChanged();
103 void placeholderTextChanged();
104 void focusReasonChanged();
105 void pressAndHold(QQuickMouseEvent *event);
106 // 2.1 (Qt 5.8)
107 Q_REVISION(2, 1) void pressed(QQuickMouseEvent *event);
108 Q_REVISION(2, 1) void released(QQuickMouseEvent *event);
109 Q_REVISION(2, 1) void hoveredChanged();
110 Q_REVISION(2, 1) void hoverEnabledChanged();
111 // 2.5 (Qt 5.12)
112 Q_REVISION(2, 5) void placeholderTextColorChanged();
113 Q_REVISION(2, 5) void implicitBackgroundWidthChanged();
114 Q_REVISION(2, 5) void implicitBackgroundHeightChanged();
115 Q_REVISION(2, 5) void topInsetChanged();
116 Q_REVISION(2, 5) void leftInsetChanged();
117 Q_REVISION(2, 5) void rightInsetChanged();
118 Q_REVISION(2, 5) void bottomInsetChanged();
119
120protected:
121 friend struct QQuickPressHandler;
122
123 void classBegin() override;
124 void componentComplete() override;
125
126 void itemChange(ItemChange change, const ItemChangeData &value) override;
127 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
128 virtual void insetChange(const QMarginsF &newInset, const QMarginsF &oldInset);
129
130 QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) override;
131
132 void focusInEvent(QFocusEvent *event) override;
133 void focusOutEvent(QFocusEvent *event) override;
134#if QT_CONFIG(quicktemplates2_hover)
135 void hoverEnterEvent(QHoverEvent *event) override;
136 void hoverLeaveEvent(QHoverEvent *event) override;
137#endif
138 void mousePressEvent(QMouseEvent *event) override;
139 void mouseMoveEvent(QMouseEvent *event) override;
140 void mouseReleaseEvent(QMouseEvent *event) override;
141 void mouseDoubleClickEvent(QMouseEvent *event) override;
142 void timerEvent(QTimerEvent *event) override;
143
144private:
145 Q_DISABLE_COPY(QQuickTextField)
146 Q_DECLARE_PRIVATE(QQuickTextField)
147};
148
150
151#endif // QQUICKTEXTFIELD_P_H
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
The QFocusEvent class contains event parameters for widget focus events.
Definition qevent.h:470
\reentrant
Definition qfont.h:22
\inmodule QtGui
Definition qevent.h:246
\inmodule QtCore
Definition qmargins.h:270
\inmodule QtGui
Definition qevent.h:196
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
ItemChange
Used in conjunction with QQuickItem::itemChange() to notify the item about certain types of changes.
Definition qquickitem.h:144
\qmlproperty int QtQuick::KeyEvent::key
\inmodule QtCore\reentrant
Definition qrect.h:484
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
Definition qsgnode.h:37
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qcoreevent.h:366
QString text
Combined button and popup list for selecting options.
Definition qcompare.h:63
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLuint color
[2]
struct _cl_event * event
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_REVISION(...)
#define Q_CLASSINFO(name, value)
#define Q_SIGNALS
double qreal
Definition qtypes.h:187
#define explicit
\inmodule QtQuick
Definition qquickitem.h:159