SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
smtk
extension
qt
qtNotEditableDelegate.h
1
//=========================================================================
2
// Copyright (c) Kitware, Inc.
3
// All rights reserved.
4
// See LICENSE.txt for details.
5
//
6
// This software is distributed WITHOUT ANY WARRANTY; without even
7
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8
// PURPOSE. See the above copyright notice for more information.
9
//=========================================================================
10
11
#ifndef smtk_extension_qtNotEditableDelegate_h
12
#define smtk_extension_qtNotEditableDelegate_h
13
14
#include "smtk/extension/qt/Exports.h"
15
16
#include <QItemDelegate>
17
18
namespace
smtk
19
{
20
namespace
extension
21
{
23
24
class
SMTKQTEXT_EXPORT
qtNotEditableDelegate
:
public
QItemDelegate
25
{
26
Q_OBJECT
27
public
:
28
qtNotEditableDelegate
(QObject* parent =
nullptr
)
29
: QItemDelegate(parent)
30
{
31
}
32
33
protected
:
34
bool
editorEvent(QEvent*, QAbstractItemModel*,
const
QStyleOptionViewItem&,
const
QModelIndex&)
35
override
36
{
37
return
false
;
38
}
39
QWidget* createEditor(QWidget*,
const
QStyleOptionViewItem&,
const
QModelIndex&)
const override
40
{
41
return
nullptr
;
42
}
43
44
};
// class
45
};
// namespace extension
46
};
// namespace smtk
47
48
#endif
smtk
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition:
doc.h:33
smtk::extension::qtNotEditableDelegate
Simple delegate that prevents contents from being modified.
Definition:
qtNotEditableDelegate.h:24
Generated by
1.8.17