Loading...
Searching...
No Matches
shortcutTableView.h
Go to the documentation of this file.
#ifndef BALL_VIEW_WIDGETS_SHORTCUTTABLEVIEW_H
#define BALL_VIEW_WIDGETS_SHORTCUTTABLEVIEW_H
#ifndef BALL_VIEW_KERNEL_COMMON_H
# include <BALL/VIEW/KERNEL/common.h>
#endif
#ifndef BALL_VIEW_DIALOGS_EDITSINGLESHORTCUT_H
# include <BALL/VIEW/DIALOGS/editSingleShortcut.h>
#endif
#include <QtWidgets/QTableView>
#include <QtWidgets/QItemDelegate>
#include <QtWidgets/QPushButton>
class QSortFilterProxyModel;
namespace BALL
{
namespace VIEW
{
class BALL_VIEW_EXPORT ShortcutTableView : public QTableView
{
Q_OBJECT
public:
ShortcutTableView(QWidget* parent);
virtual ~ShortcutTableView();
void setFilter(const QString& filter);
Q_SIGNALS:
void shortcutChanged();
protected Q_SLOTS:
void editSuccess_();
void onClick(const QModelIndex& index);
private:
QSortFilterProxyModel* proxy_model_;
EditSingleShortcut* editor_;
int edited_row_;
};
class ShortcutTableModel : public QAbstractTableModel
{
Q_OBJECT
public:
ShortcutTableModel(ShortcutRegistry* reg);
int rowCount(const QModelIndex& parent = QModelIndex()) const;
int columnCount(const QModelIndex& parent = QModelIndex()) const;
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
Qt::ItemFlags flags(const QModelIndex& index) const;
bool isValid(const QKeySequence& seq) const;
bool setData(const QModelIndex& index, const QVariant& data, int role = Qt::EditRole);
private:
ShortcutRegistry* registry_;
};
}
}
#endif //BALL_VIEW_WIDGETS_SHORTCUTTABLEVIEW_H
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition COMMON/global.h:52
common.h
BALL::VIEW::EditSingleShortcut
Definition editSingleShortcut.h:38
BALL::VIEW::ShortcutRegistry
Definition shortcutRegistry.h:40
BALL::VIEW::ShortcutTableModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const
BALL::VIEW::ShortcutTableModel::flags
Qt::ItemFlags flags(const QModelIndex &index) const
BALL::VIEW::ShortcutTableModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
BALL::VIEW::ShortcutTableModel::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
BALL::VIEW::ShortcutTableModel::setData
bool setData(const QModelIndex &index, const QVariant &data, int role=Qt::EditRole)
BALL::VIEW::ShortcutTableModel::ShortcutTableModel
ShortcutTableModel(ShortcutRegistry *reg)
BALL::VIEW::ShortcutTableModel::isValid
bool isValid(const QKeySequence &seq) const
BALL::VIEW::ShortcutTableModel::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const
BALL::VIEW::ShortcutTableView::onClick
void onClick(const QModelIndex &index)
BALL::VIEW::ShortcutTableView::shortcutChanged
void shortcutChanged()
BALL::VIEW::ShortcutTableView::~ShortcutTableView
virtual ~ShortcutTableView()
BALL::VIEW::ShortcutTableView::editSuccess_
void editSuccess_()
BALL::VIEW::ShortcutTableView::setFilter
void setFilter(const QString &filter)
BALL::VIEW::ShortcutTableView::ShortcutTableView
ShortcutTableView(QWidget *parent)
QAbstractTableModel
QTableView
QWidget
editSingleShortcut.h
BALL::VIEW
Definition constraints.h:35
BALL
Definition constants.h:13