itom
Loading...
Searching...
No Matches
dataObjectDelegate.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 In addition, as a special exception, the Institut für Technische
23 Optik (ITO) gives you certain additional rights.
24 These rights are described in the ITO LGPL Exception version 1.0,
25 which can be found in the file LGPL_EXCEPTION.txt in this package.
26*********************************************************************** */
27
28#ifndef DATAOBJECTDELEGATE_H
29#define DATAOBJECTDELEGATE_H
30
31#include "DataObject/dataobj.h"
32
33#include <qabstractitemmodel.h>
34#include <qheaderview.h>
35#include <qitemdelegate.h>
36#include <qsharedpointer.h>
37#include <qstringlist.h>
38#include <qtableview.h>
39
40class DataObjectDelegate : public QItemDelegate
41{
42 Q_OBJECT
43
44public:
45 DataObjectDelegate(QObject* parent = 0);
46 virtual ~DataObjectDelegate();
47
48 QWidget* createEditor(
49 QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const;
50 void setEditorData(QWidget* editor, const QModelIndex& index) const;
51 void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const;
52 void updateEditorGeometry(
53 QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const;
54
55 friend class DataObjectTable;
56
57private:
58 double m_min;
59 double m_max;
60 int m_editorDecimals;
61 QStringList m_suffixes;
62};
63
64#endif // DATAOBJECTDELEGATE_H
Definition dataObjectDelegate.h:41
Definition dataObjectTable.h:47