forked from teamnwah/openmw-tes3coop
created new files
This commit is contained in:
parent
a0146e2e28
commit
8c6a0d9a4f
3 changed files with 55 additions and 1 deletions
|
@ -170,7 +170,7 @@ namespace CSVWorld
|
|||
QWidget* mMainWidget;
|
||||
CSMWorld::IdTable* mTable;
|
||||
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:
|
||||
|
||||
|
|
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…
Reference in a new issue