1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-20 21:53:52 +00:00
openmw/apps/opencs/view/world/globals.cpp

28 lines
827 B
C++
Raw Normal View History

#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);
2012-11-27 09:42:46 +00:00
table->setSelectionBehavior (QAbstractItemView::SelectRows);
table->setSelectionMode (QAbstractItemView::ExtendedSelection);
/// \todo make initial layout fill the whole width of the table
}