BALL
1.4.79
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 <QtGui/QTableView>
13
#include <QtGui/QItemDelegate>
14
#include <QtGui/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
signals:
33
void
shortcutChanged();
34
35
protected
slots:
36
void
editSuccess_();
37
38
protected
slots:
39
void
onClick(
const
QModelIndex& index);
40
41
private
:
42
QSortFilterProxyModel* proxy_model_;
43
EditSingleShortcut
* editor_;
44
int
edited_row_;
45
};
46
47
class
ShortcutTableModel
:
public
QAbstractTableModel
48
{
49
Q_OBJECT
50
51
public
:
52
ShortcutTableModel
(
ShortcutRegistry
* reg);
53
int
rowCount(
const
QModelIndex& parent = QModelIndex())
const
;
54
int
columnCount(
const
QModelIndex& parent = QModelIndex())
const
;
55
56
QVariant data(
const
QModelIndex& index,
int
role = Qt::DisplayRole)
const
;
57
QVariant headerData(
int
section, Qt::Orientation orientation,
int
role = Qt::DisplayRole)
const
;
58
Qt::ItemFlags flags(
const
QModelIndex& index)
const
;
59
bool
isValid(
const
QKeySequence& seq)
const
;
60
bool
setData(
const
QModelIndex& index,
const
QVariant& data,
int
role = Qt::EditRole);
61
private
:
62
ShortcutRegistry
* registry_;
63
};
64
65
}
66
}
67
68
#endif //BALL_VIEW_WIDGETS_SHORTCUTTABLEVIEW_H
69
BALL::VIEW::ShortcutTableModel
Definition:
shortcutTableView.h:47
QWidget
common.h
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition:
COMMON/global.h:52
BALL::VIEW::ShortcutRegistry
Definition:
shortcutRegistry.h:36
QTableView
editSingleShortcut.h
BALL
-*- Mode: C++; tab-width: 2; -*-
Definition:
constants.h:12
BALL::VIEW::EditSingleShortcut
Definition:
editSingleShortcut.h:35
BALL::VIEW::ShortcutTableView
Definition:
shortcutTableView.h:22
QAbstractTableModel
Generated by
1.8.13