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
4#ifndef QQUICKMATERIALPLACEHOLDERTEXT_P_H
5#define QQUICKMATERIALPLACEHOLDERTEXT_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 <QtCore/private/qglobal_p.h>
19#include <QtGui/qcolor.h>
20#include <QtQuickControls2Impl/private/qquickplaceholdertext_p.h>
21
22#include <QtCore/qpointer.h>
23
24QT_BEGIN_NAMESPACE
25
26class QParallelAnimationGroup;
27
29{
30 Q_OBJECT
31 Q_PROPERTY(bool filled READ isFilled WRITE setFilled NOTIFY filledChanged FINAL)
44
45public:
47
48 bool isFilled() const;
49 void setFilled(bool filled);
50
51 int largestHeight() const;
52
53 bool controlHasActiveFocus() const;
54 void setControlHasActiveFocus(bool controlHasActiveFocus);
55
56 bool controlHasText() const;
57 void setControlHasText(bool controlHasText);
58
60 void setControlImplicitBackgroundHeight(qreal controlImplicitBackgroundHeight);
61
62 qreal controlHeight() const;
63 void setControlHeight(qreal controlHeight);
64
65 qreal verticalPadding() const;
66 void setVerticalPadding(qreal verticalPadding);
67
68 void setLeftPadding(int leftPadding);
69 void setFloatingLeftPadding(int floatingLeftPadding);
77
78private slots:
80
81private:
82 bool shouldFloat() const;
83 bool shouldAnimate() const;
84
85 void updateY();
86 void updateX();
87 qreal normalTargetY() const;
88 qreal floatingTargetY() const;
89 qreal normalTargetX() const;
90 qreal floatingTargetX() const;
91
92 void controlGotActiveFocus();
93 void controlLostActiveFocus();
94
95 void maybeSetFocusAnimationProgress();
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_focusInAnimation;
109 QPointer<QParallelAnimationGroup> m_focusOutAnimation;
110};
111
112QT_END_NAMESPACE
113
114#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)
Combined button and popup list for selecting options.
static QT_BEGIN_NAMESPACE const qreal floatingScale
Q_GLOBAL_STATIC(QEasingCurve, animationEasingCurve, QEasingCurve::OutSine)
qreal controlTopInset(QQuickItem *textControl)