-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathFileTypesDelegate.h
75 lines (64 loc) · 2.5 KB
/
FileTypesDelegate.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//-----------------------------------------------------------------------------
// File: FileTypesDelegate.h
//-----------------------------------------------------------------------------
// Project: Kactus 2
// Author: Joni-Matti Maatta
// Date: 20.02.2013
//
// Description:
// Delegate which provides widgets for the file types settings view.
//-----------------------------------------------------------------------------
#ifndef FILETYPESDELEGATE_H
#define FILETYPESDELEGATE_H
#include <QStyledItemDelegate>
//-----------------------------------------------------------------------------
//! Delegate which provides widgets for the file types settings view.
//-----------------------------------------------------------------------------
class FileTypesDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
/*!
* Constructor.
*
* @param [in] revision The applied IP-XACT standard.
* @param [in] parent Pointer to the owner of this instance.
*/
FileTypesDelegate(QObject* parent = nullptr);
/*!
* Destructor.
*/
virtual ~FileTypesDelegate() = default;
// Disable copying.
FileTypesDelegate(FileTypesDelegate const& rhs) = delete;
FileTypesDelegate& operator=(FileTypesDelegate const& rhs) = delete;
/*!
* Creates a new editor for the given item.
*
* @param [in] parent Owner for the editor.
* @param [in] option Contains options for the editor.
* @param [in] index Model index identifying the item.
*
* @return The editor to be used to edit the item.
*/
virtual QWidget* createEditor(QWidget* parent, QStyleOptionViewItem const& option,
QModelIndex const& index) const;
/*!
* Sets the data for the editor.
*
* @param [in] editor Pointer to the editor where the data is to be set.
* @param [in] index Model index identifying the item that's data is to be set.
*/
virtual void setEditorData(QWidget* editor, const QModelIndex& index) const;
/*!
* Saves the data from the editor to the model.
*
* @param [in] editor Pointer to the editor that contains the data to store.
* @param [in] model Model that contains the data structure where data is to be saved to.
* @param [in] index Model index identifying the item that's data is to be saved.
*
*/
virtual void setModelData(QWidget* editor, QAbstractItemModel* model,
QModelIndex const& index) const;
};
#endif // FILETYPESDELEGATE_H