itom
Loading...
Searching...
No Matches
dataObjectMetaWidget.h
1/* ********************************************************************
2 itom measurement system
3 URL: http://www.uni-stuttgart.de/ito
4 Copyright (C) 2021, Institut für Technische Optik (ITO),
5 Universität Stuttgart, Germany
6
7 This file is part of itom.
8
9 itom is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 itom is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with itom. If not, see <http://www.gnu.org/licenses/>.
21*********************************************************************** */
22
23#ifndef DATAOBJECTMETAWIDGET_H
24#define DATAOBJECTMETAWIDGET_H
25
26#include "DataObject/dataobj.h"
27
28#include <qtreewidget.h>
29#include <qsharedpointer.h>
30
31#include "commonWidgets.h"
32
33
34class ITOMWIDGETS_EXPORT DataObjectMetaWidget : public QTreeWidget
35{
36 Q_OBJECT
37
38 Q_PROPERTY(QSharedPointer<ito::DataObject> data READ getData WRITE setData DESIGNABLE false);
39 Q_PROPERTY(bool readOnlyEnabled READ getReadOnly WRITE setReadOnly DESIGNABLE true);
40 Q_PROPERTY(bool detailedInfo READ getDetailedStatus WRITE setDetailedStatus DESIGNABLE true);
41 Q_PROPERTY(bool previewEnabled READ getPreviewStatus WRITE setPreviewStatus DESIGNABLE true);
42 Q_PROPERTY(int previewSize READ getPreviewSize WRITE setPreviewSize DESIGNABLE true);
43 Q_PROPERTY(int decimals READ getDecimals WRITE setDecimals DESIGNABLE true);
44 //Q_PROPERTY(QString colorBar READ getColorMap WRITE setColorMap DESIGNABLE true)
45
46 Q_CLASSINFO("prop://data", "The dataObject to read the meta data from.")
47 Q_CLASSINFO("prop://readOnlyEnabled", "Enable / disable modification of meta data, (not supported).")
48 Q_CLASSINFO("prop://decimals", "Number of decimals to show.")
49 Q_CLASSINFO("prop://previewEnabled", "Add a preview to the meta data.")
50 Q_CLASSINFO("prop://previewSize", "Set the preview size.")
51 Q_CLASSINFO("prop://detailedInfo", "Toggle between basic and detailed metaData.")
52 //Q_CLASSINFO("prop://colorBar", "Name of the color bar for the preview.")
53
54
55public:
56 DataObjectMetaWidget(QWidget* parent = 0);
58
59 void setData(QSharedPointer<ito::DataObject> dataObj);
60 QSharedPointer<ito::DataObject> getData() const;
61
62 bool getReadOnly() const {return m_readOnly;};
63 void setReadOnly(const bool value);
64
65 int getDecimals() const {return m_decimals;};
66 void setDecimals(const int value);
67
68 bool getPreviewStatus() const {return m_preview;};
69 void setPreviewStatus(const bool value);
70
71 int getPreviewSize() const {return m_previewSize;};
72 void setPreviewSize(const int value);
73
74 bool getDetailedStatus() const {return m_detailedStatus;};
75 void setDetailedStatus(const bool value);
76 //QString getColorMap() const {return m_colorBarName;};
77 //void setColorMap(const QString &name);
78
79 virtual QSize sizeHint() const;
80
81
82protected:
83
84private:
85 bool m_readOnly;
86 bool m_preview;
87 bool m_detailedStatus;
88 int m_previewSize;
89 int m_decimals;
90 QString m_colorBarName;
91 QVector<ito::uint32> m_colorTable;
92
93 ito::DataObject m_data;
94};
95
96#endif
Definition dataObjectMetaWidget.h:35
dataObject contains a n-dimensional matrix
Definition dataobj.h:591