NorMIT-nav
22.09
An IGT application
cxRequestEnterStateTransition.h
Go to the documentation of this file.
1
/*=========================================================================
2
This file is part of CustusX, an Image Guided Therapy Application.
3
4
Copyright (c) SINTEF Department of Medical Technology.
5
All rights reserved.
6
7
CustusX is released under a BSD 3-Clause license.
8
9
See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10
=========================================================================*/
11
12
#ifndef CXREQUESTENTERSTATETRANSITION_H_
13
#define CXREQUESTENTERSTATETRANSITION_H_
14
15
#include "cxResourceExport.h"
16
17
#include <QEvent>
18
#include <QAbstractTransition>
19
20
namespace
cx
21
{
31
struct
cxResource_EXPORT
RequestEnterStateEvent
:
public
QEvent
32
{
33
RequestEnterStateEvent
(
const
QString &stateUid) :
34
QEvent(QEvent::Type(QEvent::User + 1)), mStateUid(stateUid)
35
{}
36
37
QString
mStateUid
;
38
};
39
45
class
cxResource_EXPORT
RequestEnterStateTransition
:
public
QAbstractTransition
46
{
47
public
:
48
RequestEnterStateTransition
(
const
QString &stateUid) :
49
mStateUid(stateUid)
50
{}
51
52
protected
:
53
virtual
bool
eventTest
(QEvent *e)
54
{
55
if
(e->type() != QEvent::Type(QEvent::User + 1))
// StringEvent
56
return
false
;
57
RequestEnterStateEvent
*se =
static_cast<
RequestEnterStateEvent
*
>
(e);
58
return
(mStateUid == se->
mStateUid
);
59
}
60
61
virtual
void
onTransition
(QEvent *)
62
{}
63
64
private
:
65
QString mStateUid;
66
};
67
71
}
//namespace cx
72
#endif
/* CXREQUESTENTERSTATETRANSITION_H_ */
cx::RequestEnterStateEvent::RequestEnterStateEvent
RequestEnterStateEvent(const QString &stateUid)
Definition:
cxRequestEnterStateTransition.h:33
cx
Namespace for all CustusX production code.
Definition:
cx_dev_group_definitions.h:13
cx::RequestEnterStateEvent
Utility class for StateService states.
Definition:
cxRequestEnterStateTransition.h:31
cx::RequestEnterStateTransition::onTransition
virtual void onTransition(QEvent *)
Definition:
cxRequestEnterStateTransition.h:61
cx::RequestEnterStateEvent::mStateUid
QString mStateUid
Definition:
cxRequestEnterStateTransition.h:37
cx::RequestEnterStateTransition::RequestEnterStateTransition
RequestEnterStateTransition(const QString &stateUid)
Definition:
cxRequestEnterStateTransition.h:48
cx::RequestEnterStateTransition::eventTest
virtual bool eventTest(QEvent *e)
Definition:
cxRequestEnterStateTransition.h:53
cx::RequestEnterStateTransition
Utility class for StateService states.
Definition:
cxRequestEnterStateTransition.h:45
CX
source
resource
core
settings
cxRequestEnterStateTransition.h
Generated on Tue Sep 13 2022 11:06:15 for NorMIT-nav by
1.8.17