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
qquicktextarea_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 QQUICKTEXTAREA_P_H
5#define QQUICKTEXTAREA_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/qquicktextedit_p.h>
20#include <QtQuick/private/qquickevents_p_p.h>
21#include <QtQuickTemplates2/private/qtquicktemplates2global_p.h>
22
24
25class QQuickText;
28
29class Q_QUICKTEMPLATES2_EXPORT QQuickTextArea : public QQuickTextEdit
30{
32 Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged) // override
33 Q_PROPERTY(qreal implicitWidth READ implicitWidth WRITE setImplicitWidth NOTIFY implicitWidthChanged3 FINAL)
34 Q_PROPERTY(qreal implicitHeight READ implicitHeight WRITE setImplicitHeight NOTIFY implicitHeightChanged3 FINAL)
35 Q_PROPERTY(QQuickItem *background READ background WRITE setBackground NOTIFY backgroundChanged FINAL)
36 Q_PROPERTY(QString placeholderText READ placeholderText WRITE setPlaceholderText NOTIFY placeholderTextChanged FINAL)
37 Q_PROPERTY(Qt::FocusReason focusReason READ focusReason WRITE setFocusReason NOTIFY focusReasonChanged FINAL)
38 // 2.1 (Qt 5.8)
39 Q_PROPERTY(bool hovered READ isHovered NOTIFY hoveredChanged FINAL REVISION(2, 1))
40 Q_PROPERTY(bool hoverEnabled READ isHoverEnabled WRITE setHoverEnabled RESET resetHoverEnabled NOTIFY hoverEnabledChanged FINAL REVISION(2, 1))
41 // 2.5 (Qt 5.12)
42 Q_PROPERTY(QColor placeholderTextColor READ placeholderTextColor WRITE setPlaceholderTextColor NOTIFY placeholderTextColorChanged FINAL REVISION(2, 5))
43 Q_PROPERTY(qreal implicitBackgroundWidth READ implicitBackgroundWidth NOTIFY implicitBackgroundWidthChanged FINAL REVISION(2, 5))
44 Q_PROPERTY(qreal implicitBackgroundHeight READ implicitBackgroundHeight NOTIFY implicitBackgroundHeightChanged FINAL REVISION(2, 5))
45 Q_PROPERTY(qreal topInset READ topInset WRITE setTopInset RESET resetTopInset NOTIFY topInsetChanged FINAL REVISION(2, 5))
46 Q_PROPERTY(qreal leftInset READ leftInset WRITE setLeftInset RESET resetLeftInset NOTIFY leftInsetChanged FINAL REVISION(2, 5))
47 Q_PROPERTY(qreal rightInset READ rightInset WRITE setRightInset RESET resetRightInset NOTIFY rightInsetChanged FINAL REVISION(2, 5))
48 Q_PROPERTY(qreal bottomInset READ bottomInset WRITE setBottomInset RESET resetBottomInset NOTIFY bottomInsetChanged FINAL REVISION(2, 5))
49 Q_CLASSINFO("DeferredPropertyNames", "background")
50 QML_NAMED_ELEMENT(TextArea)
53
54public:
55 explicit QQuickTextArea(QQuickItem *parent = nullptr);
57
58 static QQuickTextAreaAttached *qmlAttachedProperties(QObject *object);
59
60 QFont font() const;
61 void setFont(const QFont &font);
62
63 QQuickItem *background() const;
64 void setBackground(QQuickItem *background);
65
66 QString placeholderText() const;
67 void setPlaceholderText(const QString &text);
68
69 Qt::FocusReason focusReason() const;
70 void setFocusReason(Qt::FocusReason reason);
71
72 bool contains(const QPointF &point) const override;
73
74 // 2.1 (Qt 5.8)
75 bool isHovered() const;
76 void setHovered(bool hovered);
77
78 bool isHoverEnabled() const;
79 void setHoverEnabled(bool enabled);
80 void resetHoverEnabled();
81
82 // 2.5 (Qt 5.12)
83 QColor placeholderTextColor() const;
84 void setPlaceholderTextColor(const QColor &color);
85
86 qreal implicitBackgroundWidth() const;
87 qreal implicitBackgroundHeight() const;
88
89 qreal topInset() const;
90 void setTopInset(qreal inset);
91 void resetTopInset();
92
93 qreal leftInset() const;
94 void setLeftInset(qreal inset);
95 void resetLeftInset();
96
97 qreal rightInset() const;
98 void setRightInset(qreal inset);
99 void resetRightInset();
100
101 qreal bottomInset() const;
102 void setBottomInset(qreal inset);
103 void resetBottomInset();
104
106 void fontChanged();
107 void implicitWidthChanged3();
108 void implicitHeightChanged3();
109 void backgroundChanged();
110 void placeholderTextChanged();
111 void focusReasonChanged();
112 void pressAndHold(QQuickMouseEvent *event);
113 // 2.1 (Qt 5.8)
114 Q_REVISION(2, 1) void pressed(QQuickMouseEvent *event);
115 Q_REVISION(2, 1) void released(QQuickMouseEvent *event);
116 Q_REVISION(2, 1) void hoveredChanged();
117 Q_REVISION(2, 1) void hoverEnabledChanged();
118 // 2.5 (Qt 5.12)
119 Q_REVISION(2, 5) void placeholderTextColorChanged();
120 Q_REVISION(2, 5) void implicitBackgroundWidthChanged();
121 Q_REVISION(2, 5) void implicitBackgroundHeightChanged();
122 Q_REVISION(2, 5) void topInsetChanged();
123 Q_REVISION(2, 5) void leftInsetChanged();
124 Q_REVISION(2, 5) void rightInsetChanged();
125 Q_REVISION(2, 5) void bottomInsetChanged();
126
127protected:
128 friend struct QQuickPressHandler;
129
130 void classBegin() override;
131 void componentComplete() override;
132
133 void itemChange(ItemChange change, const ItemChangeData &value) override;
134 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
135 virtual void insetChange(const QMarginsF &newInset, const QMarginsF &oldInset);
136
137 QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) override;
138
139 void focusInEvent(QFocusEvent *event) override;
140 void focusOutEvent(QFocusEvent *event) override;
141#if QT_CONFIG(quicktemplates2_hover)
142 void hoverEnterEvent(QHoverEvent *event) override;
143 void hoverLeaveEvent(QHoverEvent *event) override;
144#endif
145 void mousePressEvent(QMouseEvent *event) override;
146 void mouseMoveEvent(QMouseEvent *event) override;
147 void mouseReleaseEvent(QMouseEvent *event) override;
148 void mouseDoubleClickEvent(QMouseEvent *event) override;
149 void timerEvent(QTimerEvent *event) override;
150
151private:
152 Q_DISABLE_COPY(QQuickTextArea)
153 Q_DECLARE_PRIVATE(QQuickTextArea)
154};
155
157
158class Q_QUICKTEMPLATES2_EXPORT QQuickTextAreaAttached : public QObject
159{
161 Q_PROPERTY(QQuickTextArea *flickable READ flickable WRITE setFlickable NOTIFY flickableChanged FINAL)
162
163public:
164 explicit QQuickTextAreaAttached(QObject *parent);
165
166 QQuickTextArea *flickable() const;
167 void setFlickable(QQuickTextArea *control);
168
171
172private:
173 Q_DISABLE_COPY(QQuickTextAreaAttached)
174 Q_DECLARE_PRIVATE(QQuickTextAreaAttached)
175};
176
178
179#endif // QQUICKTEXTAREA_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
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore\reentrant
Definition qpoint.h:217
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]
static bool contains(const QJsonArray &haystack, unsigned needle)
Definition qopengl.cpp:116
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 QML_ATTACHED(ATTACHED_TYPE)
#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