Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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#ifndef QQUICKINDICATORBUTTON_H
4#define QQUICKINDICATORBUTTON_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#include <QtQuickTemplates2/private/qquickcontrol_p.h>
18#include <QtQml/qjsvalue.h>
20
22
24
25class Q_QUICKTEMPLATES2_EXPORT QQuickIndicatorButton : public QObject
26{
28 Q_PROPERTY(bool pressed READ isPressed WRITE setPressed NOTIFY pressedChanged FINAL)
29 Q_PROPERTY(QQuickItem *indicator READ indicator WRITE setIndicator NOTIFY indicatorChanged FINAL)
30 // 2.1 (Qt 5.8)
31 Q_PROPERTY(bool hovered READ isHovered WRITE setHovered NOTIFY hoveredChanged FINAL REVISION(2, 1))
32 // 2.5 (Qt 5.12)
33 Q_PROPERTY(qreal implicitIndicatorWidth READ implicitIndicatorWidth NOTIFY implicitIndicatorWidthChanged FINAL REVISION(2, 5))
34 Q_PROPERTY(qreal implicitIndicatorHeight READ implicitIndicatorHeight NOTIFY implicitIndicatorHeightChanged FINAL REVISION(2, 5))
35 Q_CLASSINFO("DeferredPropertyNames", "indicator")
38
39public:
41 ~QQuickIndicatorButton() override;
42
43 bool isPressed() const;
44 void setPressed(bool pressed);
45
46 QQuickItem *indicator() const;
47 void setIndicator(QQuickItem *indicator);
48
49 bool isHovered() const;
50 void setHovered(bool hovered);
51
52 qreal implicitIndicatorWidth() const;
53 qreal implicitIndicatorHeight() const;
54
56 void pressedChanged();
57 void indicatorChanged();
58 // 2.1 (Qt 5.8)
59 Q_REVISION(2, 1) void hoveredChanged();
60 // 2.5 (Qt 5.12)
61 Q_REVISION(2, 5) void implicitIndicatorWidthChanged();
62 Q_REVISION(2, 5) void implicitIndicatorHeightChanged();
63
65 Q_DISABLE_COPY(QQuickIndicatorButton)
66 Q_DECLARE_PRIVATE(QQuickIndicatorButton)
67};
68
70{
71 Q_DECLARE_PUBLIC(QQuickIndicatorButton)
72
73public:
75 {
76 return button->d_func();
77 }
78
79 void cancelIndicator();
80 void executeIndicator(bool complete = false);
81
82 bool pressed = false;
83 bool hovered = false;
84 QQuickDeferredPointer<QQuickItem> indicator;
85};
86
88
89#endif // QQUICKINDICATORBUTTON_H
\inmodule QtCore
Definition qobject.h:103
QQuickDeferredPointer< QQuickItem > indicator
static QQuickIndicatorButtonPrivate * get(QQuickIndicatorButton *button)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
QPushButton * button
[2]
Combined button and popup list for selecting options.
#define QML_ANONYMOUS
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_REVISION(...)
#define Q_CLASSINFO(name, value)
#define Q_SIGNALS
double qreal
Definition qtypes.h:187
#define explicit