Initial KeymapEditor implementation

This commit is contained in:
Jack Andersen
2018-08-05 18:20:42 -10:00
parent 2abed18784
commit 409d52c120
22 changed files with 1158 additions and 231 deletions

View File

@@ -4,6 +4,9 @@
#include <QWidget>
#include <QUndoCommand>
#include <QApplication>
#include <QSpinBox>
#include <QComboBox>
#include <QWheelEvent>
#include "ProjectModel.hpp"
class EditorWidget : public QWidget
@@ -44,4 +47,36 @@ public:
void redo();
};
class FieldSpinBox : public QSpinBox
{
Q_OBJECT
public:
explicit FieldSpinBox(QWidget* parent = Q_NULLPTR)
: QSpinBox(parent) {}
/* Don't scroll */
void wheelEvent(QWheelEvent* event) { event->ignore(); }
};
class FieldComboBox : public QComboBox
{
Q_OBJECT
public:
explicit FieldComboBox(QWidget* parent = Q_NULLPTR)
: QComboBox(parent) {}
/* Don't scroll */
void wheelEvent(QWheelEvent* event) { event->ignore(); }
};
class FieldProjectNode : public FieldComboBox
{
Q_OBJECT
ProjectModel::CollectionNode* m_collection;
public:
explicit FieldProjectNode(ProjectModel::CollectionNode* collection = Q_NULLPTR, QWidget* parent = Q_NULLPTR);
void setCollection(ProjectModel::CollectionNode* collection);
ProjectModel::CollectionNode* collection() const { return m_collection; }
};
#endif //AMUSE_EDITOR_WIDGET_HPP