cisst-saw
Loading...
Searching...
No Matches
mtsQtWidgetGenericObject.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3
4/*
5
6 Author(s): Praneeth Sadda, Anton Deguet
7 Created on: 2011-11-11
8
9 (C) Copyright 2011 Johns Hopkins University (JHU), All Rights
10 Reserved.
11
12--- begin cisst license - do not edit ---
13
14This software is provided "as is" under an open source license, with
15no warranty. The complete license can be found in license.txt and
16http://www.cisst.org/cisst/license.txt.
17
18--- end cisst license ---
19
20*/
21
22#ifndef _mtsQtWidgetGenericObject_h
23#define _mtsQtWidgetGenericObject_h
24
25class QHBoxLayout;
26#include <QWidget>
27
30
31// Always include last
33
34
36{
37 Q_OBJECT;
38
39protected:
40 QHBoxLayout * Layout;
41
42public:
44 virtual bool SetValue(const mtsGenericObject & value) = 0;
45};
46
47
49{
50 Q_OBJECT;
51
52public:
54 virtual bool GetValue(mtsGenericObject & placeHolder) const = 0;
55};
56
57
58#define MTS_QT_REGISTER_WIDGET_READ_CREATOR(type, widgetType) \
59 mtsQtWidgetGenericObjectRead * mtsQtWidget##type##ReadCreateFunction(void) { \
60 return new widgetType; \
61 } \
62 static const mtsQtWidgetFactory::WidgetReadCreator dummy##widgetType(&typeid(type), \
63 mtsQtWidget##type##ReadCreateFunction);
64
65#define MTS_QT_REGISTER_WIDGET_WRITE_CREATOR(type, widgetType) \
66 mtsQtWidgetGenericObjectWrite * mtsQtWidget##type##WriteCreateFunction(void) { \
67 return new widgetType; \
68 } \
69 static const mtsQtWidgetFactory::WidgetWriteCreator dummy##widgetType(&typeid(type), \
70 mtsQtWidget##type##WriteCreateFunction);
71
72
73#define MTS_QT_IMPLEMENT_SERVICES_AND_REGISTER_CREATORS(type, creatorRead, creatorWrite) \
74 CMN_IMPLEMENT_SERVICES(creatorRead); \
75 CMN_IMPLEMENT_SERVICES(creatorWrite); \
76 MTS_QT_REGISTER_WIDGET_READ_CREATOR(type, creatorRead); \
77 MTS_QT_REGISTER_WIDGET_WRITE_CREATOR(type, creatorWrite);
78
79#endif // _mtsQtWidgetGenericObject_h
Base class for high level objects.
Definition cmnGenericObject.h:53
Base class for data object in cisstMultiTask.
Definition mtsGenericObject.h:52
QHBoxLayout * Layout
Definition mtsQtWidgetGenericObject.h:40
virtual bool SetValue(const mtsGenericObject &value)=0
virtual bool GetValue(mtsGenericObject &placeHolder) const =0
Rules of exporting.
Defines mtsGenericObject.