1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-21 02:39:41 +00:00
openmw-tes3mp/apps/opencs/view/world/globals.cpp
2012-11-27 10:42:46 +01:00

28 lines
No EOL
827 B
C++

#include "globals.hpp"
#include <QTableView>
#include <QHeaderView>
#include <QSortFilterProxyModel>
#include "../../model/world/data.hpp"
CSVWorld::Globals::Globals (const CSMWorld::UniversalId& id, CSMWorld::Data& data)
: SubView (id)
{
QTableView *table = new QTableView();
setWidget (table);
QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel (this);
proxyModel->setSourceModel (data.getTableModel (id));
table->setModel (proxyModel);
table->horizontalHeader()->setResizeMode (QHeaderView::Interactive);
table->verticalHeader()->hide();
table->setSortingEnabled (true);
table->setSelectionBehavior (QAbstractItemView::SelectRows);
table->setSelectionMode (QAbstractItemView::ExtendedSelection);
/// \todo make initial layout fill the whole width of the table
}