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
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
25QT_BEGIN_NAMESPACE
26
27class QParallelAnimationGroup;
28
30{
31 Q_OBJECT
32 Q_PROPERTY(bool filled READ isFilled WRITE setFilled NOTIFY filledChanged FINAL)
45
46public:
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
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);
78
79private slots:
81
82private:
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
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
111QT_END_NAMESPACE
112
113#endif // QQUICKMATERIALPLACEHOLDERTEXT_P_H
void setControlImplicitBackgroundHeight(qreal controlImplicitBackgroundHeight)
void setFloatingLeftPadding(int floatingLeftPadding)
void componentComplete() override
\reimp Derived classes should call the base class method before adding their own actions to perform a...
void setControlHasActiveFocus(bool controlHasActiveFocus)
static QT_BEGIN_NAMESPACE const qreal floatingScale
Q_GLOBAL_STATIC(QEasingCurve, animationEasingCurve, QEasingCurve::OutSine)
qreal controlTopInset(QQuickItem *textControl)