mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-10-01 08:03:49 -04:00
created new files
This commit is contained in:
parent
a0146e2e28
commit
8c6a0d9a4f
@ -170,7 +170,7 @@ namespace CSVWorld
|
|||||||
QWidget* mMainWidget;
|
QWidget* mMainWidget;
|
||||||
CSMWorld::IdTable* mTable;
|
CSMWorld::IdTable* mTable;
|
||||||
QUndoStack& mUndoStack;
|
QUndoStack& mUndoStack;
|
||||||
std::vector<CSMWorld::NestedTableModel*> mNestedModels; //Plain, raw C pointers, deleted in the dtor
|
std::vector<CSMWorld::NestedTableModel*> mNestedModels; //Plain, raw C pointers, deleted in the dtor
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
20
apps/opencs/view/world/nestedtable.cpp
Normal file
20
apps/opencs/view/world/nestedtable.cpp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#include "nestedtable.hpp"
|
||||||
|
|
||||||
|
NestedTable::NestedTable(CSMDoc::Document& document, CSMWorld::NestedTableModel* model, const CSMWorld::UniversalId& id, QWidget* parent)
|
||||||
|
: QTableView(parent)
|
||||||
|
{
|
||||||
|
QTableView::setModel(model);
|
||||||
|
setAcceptDrops(true);
|
||||||
|
|
||||||
|
int columns = mModel->columnCount();
|
||||||
|
|
||||||
|
for(int i = 0 ; i < columns; ++i)
|
||||||
|
{
|
||||||
|
CSMWorld::ColumnBase::Display display = static_cast<CSMWorld::ColumnBase::Display> (
|
||||||
|
mModel->headerData (i, Qt::Horizontal, CSMWorld::ColumnBase::Role_Display).toInt());
|
||||||
|
|
||||||
|
CommandDelegate *delegate = CommandDelegateFactoryCollection::get().makeDelegate(display,
|
||||||
|
document.getUndoStack(),
|
||||||
|
this);
|
||||||
|
}
|
||||||
|
}
|
34
apps/opencs/view/world/nestedtable.hpp
Normal file
34
apps/opencs/view/world/nestedtable.hpp
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#ifndef CSV_WORLD_NESTEDTABLE_H
|
||||||
|
#define CSV_WORLD_TABLE_H
|
||||||
|
|
||||||
|
#include <QTableView>
|
||||||
|
#include <QtGui/qevent.h>
|
||||||
|
|
||||||
|
class QUndoStack;
|
||||||
|
class QAction;
|
||||||
|
|
||||||
|
namespace CSMWorld
|
||||||
|
{
|
||||||
|
class NestedTableModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace CSVWorld
|
||||||
|
{
|
||||||
|
class NestedTable : public QTableView
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
std::vector<CommandDelegate*> mDelegates;
|
||||||
|
QAction *mAddNewRowAction;
|
||||||
|
QAction *mRemoveRowAction;
|
||||||
|
CSMWorld::CommandDispatcher *mDispatcher;
|
||||||
|
|
||||||
|
public:
|
||||||
|
NestedTable(CSMDoc::Document& document, CSMWorld::NestedTableModel* model, const CSMWorld::UniversalId& id, QWidget* parent = NULL);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void dragEnterEvent(QDragEnterEvent *event);
|
||||||
|
|
||||||
|
void dragMoveEvent(QDragMoveEvent *event);
|
||||||
|
};
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user