mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 21:56:43 +08:00
71 lines
2.3 KiB
C++
71 lines
2.3 KiB
C++
/* Copyright (C) 2013
|
|
* swift project Community / Contributors
|
|
*
|
|
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
|
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
|
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
|
* contained in the LICENSE file.
|
|
*/
|
|
|
|
//! \file
|
|
|
|
#ifndef BLACKGUI_ACTIONHOTKEYLISTMODEL_H
|
|
#define BLACKGUI_ACTIONHOTKEYLISTMODEL_H
|
|
|
|
#include "blackgui/blackguiexport.h"
|
|
#include "blackmisc/input/actionhotkeylist.h"
|
|
#include <QAbstractTableModel>
|
|
|
|
namespace BlackGui
|
|
{
|
|
namespace Models
|
|
{
|
|
//! Hotkey list model
|
|
class BLACKGUI_EXPORT CActionHotkeyListModel : public QAbstractTableModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
//! Item role
|
|
enum ItemRole
|
|
{
|
|
ActionHotkeyRole = Qt::UserRole
|
|
};
|
|
|
|
//! Constructor
|
|
CActionHotkeyListModel(QObject *parent = nullptr);
|
|
|
|
//! Destructor
|
|
virtual ~CActionHotkeyListModel() {}
|
|
|
|
//! \copydoc QAbstractTableModel::rowCount
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
|
|
//! \copydoc QAbstractTableModel::columCount
|
|
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
|
|
//! \copydoc QAbstractTableModel::data
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
|
|
|
//! \copydoc QAbstractTableModel::setData
|
|
bool setData(const QModelIndex &index, const QVariant &var, int role) override;
|
|
|
|
//! \copydoc QAbstractTableModel::headerData
|
|
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
|
|
|
|
//! \copydoc QAbstractTableModel::insertRows
|
|
bool insertRows(int position, int rows, const QModelIndex &index) override;
|
|
|
|
//! \copydoc QAbstractTableModel::removeRows
|
|
bool removeRows(int position, int rows, const QModelIndex &index) override;
|
|
|
|
//! Clear model
|
|
void clear();
|
|
|
|
private:
|
|
BlackMisc::Input::CActionHotkeyList m_actionHotkeys;
|
|
};
|
|
}
|
|
}
|
|
#endif // guard
|