mirror of
https://github.com/AxioDL/amuse.git
synced 2025-12-10 14:07:48 +00:00
Initial KeymapEditor implementation
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "EditorWidget.hpp"
|
||||
#include "MainWindow.hpp"
|
||||
#include <QStandardItemModel>
|
||||
|
||||
EditorWidget::EditorWidget(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
@@ -16,3 +17,24 @@ void EditorUndoCommand::redo()
|
||||
{
|
||||
g_MainWindow->openEditor(m_node.get());
|
||||
}
|
||||
|
||||
FieldProjectNode::FieldProjectNode(ProjectModel::CollectionNode* collection, QWidget* parent)
|
||||
: FieldComboBox(parent)
|
||||
{
|
||||
setCollection(collection);
|
||||
}
|
||||
|
||||
void FieldProjectNode::setCollection(ProjectModel::CollectionNode* collection)
|
||||
{
|
||||
m_collection = collection;
|
||||
|
||||
if (!collection)
|
||||
{
|
||||
setModel(new QStandardItemModel(0, 1, this));
|
||||
return;
|
||||
}
|
||||
|
||||
ProjectModel* model = g_MainWindow->projectModel();
|
||||
setModel(model->getNullProxy());
|
||||
setRootModelIndex(model->getNullProxy()->mapFromSource(model->index(collection)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user