Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qquickmaterialplaceholdertext_p.h
Go to the documentation of this file.
1
// Copyright (C) 2023 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
QQUICKMATERIALPLACEHOLDERTEXT_P_H
6
#
define
QQUICKMATERIALPLACEHOLDERTEXT_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
<
QtCore
/
private
/
qglobal_p
.
h
>
20
#
include
<
QtGui
/
qcolor
.
h
>
21
#
include
<
QtQuickControls2Impl
/
private
/
qquickplaceholdertext_p
.
h
>
22
23
#
include
<
QtCore
/
qpointer
.
h
>
24
25
QT_BEGIN_NAMESPACE
26
27
class
QParallelAnimationGroup;
28
29
class
QQuickMaterialPlaceholderText
:
public
QQuickPlaceholderText
30
{
31
Q_OBJECT
32
Q_PROPERTY(
bool
filled READ isFilled WRITE setFilled NOTIFY filledChanged FINAL)
33
Q_PROPERTY
(
bool
controlHasActiveFocus
READ
controlHasActiveFocus
34
WRITE
setControlHasActiveFocus
NOTIFY
controlHasActiveFocusChanged
FINAL
)
35
Q_PROPERTY
(
bool
controlHasText
READ
controlHasText
WRITE
setControlHasText
NOTIFY
controlHasTextChanged
FINAL
)
36
Q_PROPERTY
(
int
largestHeight
READ
largestHeight
NOTIFY
largestHeightChanged
FINAL
)
37
Q_PROPERTY
(
qreal
verticalPadding
READ
verticalPadding
WRITE
setVerticalPadding
NOTIFY
verticalPaddingChanged
FINAL
)
38
Q_PROPERTY
(
qreal
controlImplicitBackgroundHeight
READ
controlImplicitBackgroundHeight
39
WRITE
setControlImplicitBackgroundHeight
NOTIFY
controlImplicitBackgroundHeightChanged
FINAL
)
40
Q_PROPERTY
(
qreal
controlHeight
READ
controlHeight
WRITE
setControlHeight
FINAL
)
41
Q_PROPERTY
(
int
leftPadding
MEMBER
m_leftPadding
WRITE
setLeftPadding
FINAL
)
42
Q_PROPERTY
(
int
floatingLeftPadding
MEMBER
m_floatingLeftPadding
WRITE
setFloatingLeftPadding
FINAL
)
43
QML_NAMED_ELEMENT
(
FloatingPlaceholderText
)
44
QML_ADDED_IN_VERSION
(6, 5)
45
46
public
:
47
explicit
QQuickMaterialPlaceholderText
(
QQuickItem
*
parent
=
nullptr
);
48
49
bool
isFilled()
const
;
50
void
setFilled(
bool
filled);
51
52
int
largestHeight()
const
;
53
54
bool
controlHasActiveFocus()
const
;
55
void
setControlHasActiveFocus(
bool
controlHasActiveFocus);
56
57
bool
controlHasText()
const
;
58
void
setControlHasText(
bool
controlHasText);
59
60
qreal controlImplicitBackgroundHeight()
const
;
61
void
setControlImplicitBackgroundHeight(qreal controlImplicitBackgroundHeight);
62
63
qreal controlHeight()
const
;
64
void
setControlHeight(qreal controlHeight);
65
66
qreal verticalPadding()
const
;
67
void
setVerticalPadding(qreal verticalPadding);
68
69
void
setLeftPadding(
int
leftPadding);
70
void
setFloatingLeftPadding(
int
floatingLeftPadding);
71
signals
:
72
void
filledChanged
();
73
void
largestHeightChanged();
74
void
controlHasActiveFocusChanged();
75
void
controlHasTextChanged();
76
void
controlImplicitBackgroundHeightChanged();
77
void
verticalPaddingChanged();
78
79
private
slots
:
80
void
adjustTransformOrigin
();
81
82
private
:
83
bool
shouldFloat()
const
;
84
bool
shouldAnimate()
const
;
85
86
void
updateY();
87
void
updateX();
88
qreal normalTargetY()
const
;
89
qreal floatingTargetY()
const
;
90
qreal normalTargetX()
const
;
91
qreal floatingTargetX()
const
;
92
93
void
controlActiveFocusChanged();
94
95
void
updateFocusAnimation(
bool
createIfNeeded =
false
);
96
97
void
componentComplete() override;
98
99
bool
m_filled =
false
;
100
bool
m_controlHasActiveFocus =
false
;
101
bool
m_controlHasText =
false
;
102
int
m_largestHeight = 0;
103
qreal m_verticalPadding = 0;
104
qreal m_controlImplicitBackgroundHeight = 0;
105
qreal m_controlHeight = 0;
106
int
m_leftPadding = 0;
107
int
m_floatingLeftPadding = 0;
108
QPointer<QParallelAnimationGroup> m_focusAnimation;
109
};
110
111
QT_END_NAMESPACE
112
113
#
endif
// QQUICKMATERIALPLACEHOLDERTEXT_P_H
QQuickMaterialPlaceholderText
Definition
qquickmaterialplaceholdertext_p.h:30
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
floatingScale
static QT_BEGIN_NAMESPACE const qreal floatingScale
Definition
qquickmaterialplaceholdertext.cpp:18
Q_GLOBAL_STATIC
Q_GLOBAL_STATIC(QEasingCurve, animationEasingCurve, QEasingCurve::OutSine)
controlTopInset
qreal controlTopInset(QQuickItem *textControl)
Definition
qquickmaterialplaceholdertext.cpp:113
qtdeclarative
src
quickcontrols
material
impl
qquickmaterialplaceholdertext_p.h
Generated on
for Qt by
1.18.0