Qt 6.x
The Qt SDK
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
23
25
27{
29 Q_PROPERTY(bool filled READ isFilled WRITE setFilled NOTIFY filledChanged FINAL)
38 QML_NAMED_ELEMENT(FloatingPlaceholderText)
40
41public:
43
44 bool isFilled() const;
45 void setFilled(bool filled);
46
47 int largestHeight() const;
48
49 bool controlHasActiveFocus() const;
51
52 bool controlHasText() const;
54
57
58 qreal controlHeight() const;
60
61 qreal verticalPadding() const;
63
71
72private:
73 bool shouldFloat() const;
74 bool shouldAnimate() const;
75
76 void updateY();
77 qreal normalTargetY() const;
78 qreal floatingTargetY() const;
79
80 void controlGotActiveFocus();
81 void controlLostActiveFocus();
82
83 void maybeSetFocusAnimationProgress();
84
85 void componentComplete() override;
86
87 bool m_filled = false;
88 bool m_controlHasActiveFocus = false;
89 bool m_controlHasText = false;
90 int m_largestHeight = 0;
91 qreal m_verticalPadding = 0;
92 qreal m_controlImplicitBackgroundHeight = 0;
93 qreal m_controlHeight = 0;
94 QPointer<QParallelAnimationGroup> m_focusInAnimation;
95 QPointer<QParallelAnimationGroup> m_focusOutAnimation;
96};
97
99
100#endif // QQUICKMATERIALPLACEHOLDERTEXT_P_H
\inmodule QtCore
Definition qpointer.h:18
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:64
void setControlImplicitBackgroundHeight(qreal controlImplicitBackgroundHeight)
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.
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define signals
double qreal
Definition qtypes.h:92
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent