NorMIT-nav  22.09
An IGT application
cxSyncedValue.cpp
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 #include "cxSyncedValue.h"
13 
14 namespace cx
15 {
16 
17 SyncedValue::SyncedValue(QVariant val) :
18  mValue(val)
19 {
20 }
22 {
23  return SyncedValuePtr(new SyncedValue(val));
24 }
25 void SyncedValue::set(QVariant val)
26 {
27  if (mValue == val)
28  return;
29  mValue = val;
30  emit changed();
31 }
32 QVariant SyncedValue::get() const
33 {
34  return mValue;
35 }
36 
37 
38 } //namespace cx
cxSyncedValue.h
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::SyncedValue::SyncedValue
SyncedValue(QVariant val=QVariant())
Definition: cxSyncedValue.cpp:17
cx::SyncedValue::changed
void changed()
cx::SyncedValue::create
static SyncedValuePtr create(QVariant val=QVariant())
Definition: cxSyncedValue.cpp:21
cx::SyncedValuePtr
boost::shared_ptr< class SyncedValue > SyncedValuePtr
Definition: cxViewGroup.h:30
cx::SyncedValue::set
void set(QVariant val)
Definition: cxSyncedValue.cpp:25
cx::SyncedValue::get
QVariant get() const
Definition: cxSyncedValue.cpp:32