BALL
1.5.0
include
BALL
VIEW
WIDGETS
shortcutTableView.h
Go to the documentation of this file.
1
#ifndef BALL_VIEW_WIDGETS_SHORTCUTTABLEVIEW_H
2
#define BALL_VIEW_WIDGETS_SHORTCUTTABLEVIEW_H
3
4
#ifndef BALL_VIEW_KERNEL_COMMON_H
5
# include <
BALL/VIEW/KERNEL/common.h
>
6
#endif
7
8
#ifndef BALL_VIEW_DIALOGS_EDITSINGLESHORTCUT_H
9
# include <
BALL/VIEW/DIALOGS/editSingleShortcut.h
>
10
#endif
11
12
#include <QtWidgets/QTableView>
13
#include <QtWidgets/QItemDelegate>
14
#include <QtWidgets/QPushButton>
15
16
class
QSortFilterProxyModel;
17
18
namespace
BALL
19
{
20
namespace
VIEW
21
{
22
class
BALL_VIEW_EXPORT
ShortcutTableView
:
public
QTableView
23
{
24
Q_OBJECT
25
26
public
:
27
ShortcutTableView
(
QWidget
* parent);
28
virtual
~
ShortcutTableView
();
29
30
void
setFilter(
const
QString& filter);
31
32
Q_SIGNALS:
33
void
shortcutChanged();
34
35
protected
Q_SLOTS:
36
void
editSuccess_();
37
void
onClick(
const
QModelIndex& index);
38
39
private
:
40
QSortFilterProxyModel* proxy_model_;
41
EditSingleShortcut
* editor_;
42
int
edited_row_;
43
};
44
45
class
ShortcutTableModel
:
public
QAbstractTableModel
46
{
47
Q_OBJECT
48
49
public
:
50
ShortcutTableModel
(
ShortcutRegistry
* reg);
51
int
rowCount(
const
QModelIndex& parent = QModelIndex())
const
;
52
int
columnCount(
const
QModelIndex& parent = QModelIndex())
const
;
53
54
QVariant data(
const
QModelIndex& index,
int
role = Qt::DisplayRole)
const
;
55
QVariant headerData(
int
section, Qt::Orientation orientation,
int
role = Qt::DisplayRole)
const
;
56
Qt::ItemFlags flags(
const
QModelIndex& index)
const
;
57
bool
isValid(
const
QKeySequence& seq)
const
;
58
bool
setData(
const
QModelIndex& index,
const
QVariant& data,
int
role = Qt::EditRole);
59
private
:
60
ShortcutRegistry
* registry_;
61
};
62
63
}
64
}
65
66
#endif //BALL_VIEW_WIDGETS_SHORTCUTTABLEVIEW_H
67
BALL::VIEW::ShortcutTableModel
Definition:
shortcutTableView.h:45
QAbstractTableModel
QTableView
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition:
COMMON/global.h:52
BALL::VIEW::ShortcutTableView
Definition:
shortcutTableView.h:22
QWidget
BALL::VIEW::ShortcutRegistry
Definition:
shortcutRegistry.h:36
common.h
editSingleShortcut.h
BALL
Definition:
constants.h:12
BALL::VIEW::EditSingleShortcut
Definition:
editSingleShortcut.h:35
Generated by
1.8.13