openmw-tes3coop/apps/opencs/view/world/tablesubview.cpp

44 lines
1 KiB
C++
Raw Normal View History

#include "tablesubview.hpp"
2013-07-23 19:59:02 +00:00
#include <QVBoxLayout>
2012-12-11 12:22:43 +00:00
#include "../../model/doc/document.hpp"
#include "table.hpp"
2012-12-11 12:22:43 +00:00
CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document,
bool createAndDelete)
: SubView (id)
{
2013-07-23 19:59:02 +00:00
QVBoxLayout *layout = new QVBoxLayout;
layout->setContentsMargins (QMargins (0, 0, 0, 0));
layout->addWidget (
mTable = new Table (id, document.getData(), document.getUndoStack(), createAndDelete), 2);
QWidget *widget = new QWidget;
widget->setLayout (layout);
setWidget (widget);
connect (mTable, SIGNAL (editRequest (int)), this, SLOT (editRequest (int)));
}
void CSVWorld::TableSubView::setEditLock (bool locked)
{
mTable->setEditLock (locked);
}
void CSVWorld::TableSubView::editRequest (int row)
{
focusId (mTable->getUniversalId (row));
}
void CSVWorld::TableSubView::updateEditorSetting(const QString &settingName, const QString &settingValue)
{
mTable->updateEditorSetting(settingName, settingValue);
}