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

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