Qt 6.x
The Qt SDK
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_PRIVATE_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
113 // 2.1 (Qt 5.8)
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;
149 void timerEvent(QTimerEvent *event) override;
150
151private:
152 Q_DISABLE_COPY(QQuickTextArea)
153 Q_DECLARE_PRIVATE(QQuickTextArea)
154};
155
157
158class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickTextAreaAttached : public QObject
159{
161 Q_PROPERTY(QQuickTextArea *flickable READ flickable WRITE setFlickable NOTIFY flickableChanged FINAL)
162
163public:
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
180
181#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:469
\reentrant
Definition qfont.h:20
\inmodule QtGui
Definition qevent.h:245
\inmodule QtCore
Definition qmargins.h:274
\inmodule QtGui
Definition qevent.h:195
\inmodule QtCore
Definition qobject.h:90
virtual void timerEvent(QTimerEvent *event)
This event handler can be reimplemented in a subclass to receive timer events for the object.
Definition qobject.cpp:1433
\inmodule QtCore\reentrant
Definition qpoint.h:214
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:64
virtual Q_INVOKABLE bool contains(const QPointF &point) const
\qmlmethod bool QtQuick::Item::contains(point point)
ItemChange
Used in conjunction with QQuickItem::itemChange() to notify the item about certain types of changes.
Definition qquickitem.h:143
\qmlproperty int QtQuick::KeyEvent::key
void placeholderTextChanged()
void implicitHeightChanged3()
void fontChanged()
Q_REVISION(2, 1) void pressed(QQuickMouseEvent *event)
void implicitWidthChanged3()
void pressAndHold(QQuickMouseEvent *event)
void backgroundChanged()
void focusReasonChanged()
void setFont(const QFont &font)
void mouseMoveEvent(QMouseEvent *event) override
This is an overloaded member function, provided for convenience. It differs from the above function o...
void hoverLeaveEvent(QHoverEvent *event) override
This event handler can be reimplemented in a subclass to receive hover-leave events for an item.
void mouseReleaseEvent(QMouseEvent *event) override
This is an overloaded member function, provided for convenience. It differs from the above function o...
void mouseDoubleClickEvent(QMouseEvent *event) override
This is an overloaded member function, provided for convenience. It differs from the above function o...
void mousePressEvent(QMouseEvent *event) override
This is an overloaded member function, provided for convenience. It differs from the above function o...
void hoverEnterEvent(QHoverEvent *event) override
This event handler can be reimplemented in a subclass to receive hover-enter events for an item.
\inmodule QtCore\reentrant
Definition qrect.h:483
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
Definition qsgnode.h:37
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
\inmodule QtCore
Definition qcoreevent.h:359
QString text
Combined button and popup list for selecting options.
FocusReason
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
struct _cl_event * event
#define QML_DECLARE_TYPE(TYPE)
Definition qqml.h:19
#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:92
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent
\inmodule QtQuick
Definition qquickitem.h:158