refs #454 Improve hotkey settings component

This commit is contained in:
Roland Winklmeier
2015-08-14 20:30:35 +02:00
committed by Mathew Sutcliffe
parent 6644c73703
commit 5a82e2e6bf
17 changed files with 1257 additions and 128 deletions

View File

@@ -0,0 +1,74 @@
/* Copyright (C) 2015
* 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_ACTIONMODEL_H
#define BLACKGUI_ACTIONMODEL_H
#include "blackcore/actionbind.h"
#include <QAbstractItemModel>
#include <QScopedPointer>
namespace BlackGui
{
namespace Models
{
class ActionItem;
/*!
* Action tree model
*/
class CActionModel : public QAbstractItemModel
{
Q_OBJECT
public:
//! User roles
enum ItemRole
{
ActionRole = Qt::UserRole
};
//! Constructor
CActionModel(QObject *parent = nullptr);
//! Destructor
~CActionModel();
//! \copydoc QAbstractItemModel::data
QVariant data(const QModelIndex &index, int role) const override;
//! \copydoc QAbstractItemModel::flags
Qt::ItemFlags flags(const QModelIndex &index) const override;
//! \copydoc QAbstractItemModel::index
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
//! \copydoc QAbstractItemModel::parent
QModelIndex parent(const QModelIndex &index) const override;
//! \copydoc QAbstractItemModel::rowCount
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
//! \copydoc QAbstractItemModel::columnCount
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
private:
void setupModelData();
QScopedPointer<ActionItem> m_rootItem;
};
}
}
#endif // guard