Created masterproxylist class

actorid
graffy76 12 years ago
parent 2bc56d0b5c
commit 7389507eb5

@ -48,9 +48,10 @@ DataFilesPage::DataFilesPage(Files::ConfigurationManager &cfg, GameSettings &gam
mFilterProxyModel->setSourceModel(mPluginsProxyModel);
masterView->setModel (mMastersProxyModel);
/*
QCheckBox checkBox;
unsigned int height = checkBox.sizeHint().height() + 4;
*/
/*
mastersTable->setModel(mMastersProxyModel);
mastersTable->setObjectName("MastersTable");
@ -80,8 +81,8 @@ DataFilesPage::DataFilesPage(Files::ConfigurationManager &cfg, GameSettings &gam
pluginsTable->horizontalHeader()->setStretchLastSection(true);
pluginsTable->horizontalHeader()->hide();
pluginsTable->verticalHeader()->setDefaultSectionSize(height);
pluginsTable->verticalHeader()->setResizeMode(QHeaderView::Fixed);
//pluginsTable->verticalHeader()->setDefaultSectionSize(height);
//pluginsTable->verticalHeader()->setResizeMode(QHeaderView::Fixed);
// Adjust the tableview widths inside the splitter
QList<int> sizeList;

@ -16,6 +16,8 @@
#include <components/fileorderlist/utils/lineedit.hpp>
#include "components/fileorderlist/masterproxymodel.hpp"
FileDialog::FileDialog(QWidget *parent) :
QDialog(parent)
{
@ -24,7 +26,7 @@ FileDialog::FileDialog(QWidget *parent) :
// Models
mDataFilesModel = new DataFilesModel(this);
mMastersProxyModel = new QSortFilterProxyModel();
mMastersProxyModel = new MasterProxyModel();
mMastersProxyModel->setFilterRegExp("game"); //QString("^.*\\.esm"));
mMastersProxyModel->setFilterRole (Qt::UserRole);
mMastersProxyModel->setSourceModel(mDataFilesModel);

@ -70,6 +70,7 @@ find_package(Qt4 COMPONENTS QtCore QtGui)
if(QT_QTGUI_LIBRARY AND QT_QTCORE_LIBRARY)
add_component_qt_dir (fileorderlist
masterproxymodel
model/modelitem model/datafilesmodel model/pluginsproxymodel model/esm/esmfile
utils/profilescombobox utils/comboboxlineedit utils/lineedit utils/naturalsort
)

@ -0,0 +1,11 @@
#include "masterproxymodel.hpp"
MasterProxyModel::MasterProxyModel(QObject *parent) :
QSortFilterProxyModel(parent)
{
}
QVariant MasterProxyModel::data(const QModelIndex &index, int role) const
{
return QSortFilterProxyModel::data (index, role);
}

@ -0,0 +1,19 @@
#ifndef MASTERPROXYMODEL_HPP
#define MASTERPROXYMODEL_HPP
#include <QSortFilterProxyModel>
class MasterProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
explicit MasterProxyModel(QObject *parent = 0);
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
signals:
public slots:
};
#endif // MASTERPROXYMODEL_HPP

@ -9,9 +9,7 @@ PluginsProxyModel::~PluginsProxyModel()
{
}
QVariant PluginsProxyModel::headerData(int section, Qt::Orientation orientation, int role) const
QVariant PluginsProxyModel::data(const QModelIndex &index, int role) const
{
//if (orientation != Qt::Vertical || role != Qt::DisplayRole)
return QSortFilterProxyModel::headerData(section, orientation, role);
// return section + 1;
return QSortFilterProxyModel::data (index, role);
}

@ -12,7 +12,7 @@ public:
explicit PluginsProxyModel(QObject *parent = 0);
~PluginsProxyModel();
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
};
#endif // PLUGINSPROXYMODEL_HPP

Loading…
Cancel
Save