1// Copyright (C) 2016 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 QMOUSEEVENTTRANSITION_H
5#define QMOUSEEVENTTRANSITION_H
6
7#include <QtStateMachine/qeventtransition.h>
8
9QT_REQUIRE_CONFIG(qeventtransition);
10
11QT_BEGIN_NAMESPACE
12
13class QMouseEventTransitionPrivate;
14class QPainterPath;
15class Q_STATEMACHINE_EXPORT QMouseEventTransition : public QEventTransition
16{
17 Q_OBJECT
18 Q_PROPERTY(Qt::MouseButton button READ button WRITE setButton BINDABLE bindableButton)
19 Q_PROPERTY(Qt::KeyboardModifiers modifierMask READ modifierMask WRITE setModifierMask
20 BINDABLE bindableModifierMask)
21public:
22 QMouseEventTransition(QState *sourceState = nullptr);
23 QMouseEventTransition(QObject *object, QEvent::Type type,
24 Qt::MouseButton button, QState *sourceState = nullptr);
25 ~QMouseEventTransition();
26
27 Qt::MouseButton button() const;
28 void setButton(Qt::MouseButton button);
29 QBindable<Qt::MouseButton> bindableButton();
30
31 Qt::KeyboardModifiers modifierMask() const;
32 void setModifierMask(Qt::KeyboardModifiers modifiers);
33 QBindable<Qt::KeyboardModifiers> bindableModifierMask();
34
35 QPainterPath hitTestPath() const;
36 void setHitTestPath(const QPainterPath &path);
37
38protected:
39 void onTransition(QEvent *event) override;
40 bool eventTest(QEvent *event) override;
41
42private:
43 Q_DISABLE_COPY(QMouseEventTransition)
44 Q_DECLARE_PRIVATE(QMouseEventTransition)
45};
46
47QT_END_NAMESPACE
48
49#endif
50

source code of qtscxml/src/statemachine/gui/qmouseeventtransition.h