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
qquickindicatorbutton_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 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#ifndef QQUICKINDICATORBUTTON_H
5#define QQUICKINDICATORBUTTON_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 <QtQuickTemplates2/private/qquickcontrol_p.h>
19#include <QtQml/qjsvalue.h>
21
23
25
26class Q_QUICKTEMPLATES2_EXPORT QQuickIndicatorButton : public QObject
27{
28 Q_OBJECT
29 Q_PROPERTY(bool pressed READ isPressed WRITE setPressed NOTIFY pressedChanged FINAL)
30 Q_PROPERTY(QQuickItem *indicator READ indicator WRITE setIndicator NOTIFY indicatorChanged FINAL)
31 // 2.1 (Qt 5.8)
32 Q_PROPERTY(bool hovered READ isHovered WRITE setHovered NOTIFY hoveredChanged FINAL REVISION(2, 1))
33 // 2.5 (Qt 5.12)
34 Q_PROPERTY(qreal implicitIndicatorWidth READ implicitIndicatorWidth NOTIFY implicitIndicatorWidthChanged FINAL REVISION(2, 5))
35 Q_PROPERTY(qreal implicitIndicatorHeight READ implicitIndicatorHeight NOTIFY implicitIndicatorHeightChanged FINAL REVISION(2, 5))
36 Q_CLASSINFO("DeferredPropertyNames", "indicator")
37 QML_ANONYMOUS
38 QML_ADDED_IN_VERSION(2, 0)
39
40public:
41 explicit QQuickIndicatorButton(QObject *parent);
42 ~QQuickIndicatorButton() override;
43
44 bool isPressed() const;
45 void setPressed(bool pressed);
46
47 QQuickItem *indicator() const;
48 void setIndicator(QQuickItem *indicator);
49
50 bool isHovered() const;
51 void setHovered(bool hovered);
52
53 qreal implicitIndicatorWidth() const;
54 qreal implicitIndicatorHeight() const;
55
56Q_SIGNALS:
57 void pressedChanged();
58 void indicatorChanged();
59 // 2.1 (Qt 5.8)
60 Q_REVISION(2, 1) void hoveredChanged();
61 // 2.5 (Qt 5.12)
62 Q_REVISION(2, 5) void implicitIndicatorWidthChanged();
63 Q_REVISION(2, 5) void implicitIndicatorHeightChanged();
64
65private:
66 Q_DISABLE_COPY(QQuickIndicatorButton)
67 Q_DECLARE_PRIVATE(QQuickIndicatorButton)
68};
69
71{
72 Q_DECLARE_PUBLIC(QQuickIndicatorButton)
73
74public:
79
80 void cancelIndicator();
81 void executeIndicator(bool complete = false);
82
83 bool pressed = false;
84 bool hovered = false;
86};
87
88QT_END_NAMESPACE
89
90#endif // QQUICKINDICATORBUTTON_H
QQuickDeferredPointer< QQuickItem > indicator
void executeIndicator(bool complete=false)