mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 15:35:23 +00:00
Created masterproxylist class
This commit is contained in:
parent
2bc56d0b5c
commit
7389507eb5
@ -48,9 +48,10 @@ DataFilesPage::DataFilesPage(Files::ConfigurationManager &cfg, GameSettings &gam
|
|||||||
mFilterProxyModel->setSourceModel(mPluginsProxyModel);
|
mFilterProxyModel->setSourceModel(mPluginsProxyModel);
|
||||||
|
|
||||||
masterView->setModel (mMastersProxyModel);
|
masterView->setModel (mMastersProxyModel);
|
||||||
|
/*
|
||||||
QCheckBox checkBox;
|
QCheckBox checkBox;
|
||||||
unsigned int height = checkBox.sizeHint().height() + 4;
|
unsigned int height = checkBox.sizeHint().height() + 4;
|
||||||
|
*/
|
||||||
/*
|
/*
|
||||||
mastersTable->setModel(mMastersProxyModel);
|
mastersTable->setModel(mMastersProxyModel);
|
||||||
mastersTable->setObjectName("MastersTable");
|
mastersTable->setObjectName("MastersTable");
|
||||||
@ -80,8 +81,8 @@ DataFilesPage::DataFilesPage(Files::ConfigurationManager &cfg, GameSettings &gam
|
|||||||
pluginsTable->horizontalHeader()->setStretchLastSection(true);
|
pluginsTable->horizontalHeader()->setStretchLastSection(true);
|
||||||
pluginsTable->horizontalHeader()->hide();
|
pluginsTable->horizontalHeader()->hide();
|
||||||
|
|
||||||
pluginsTable->verticalHeader()->setDefaultSectionSize(height);
|
//pluginsTable->verticalHeader()->setDefaultSectionSize(height);
|
||||||
pluginsTable->verticalHeader()->setResizeMode(QHeaderView::Fixed);
|
//pluginsTable->verticalHeader()->setResizeMode(QHeaderView::Fixed);
|
||||||
|
|
||||||
// Adjust the tableview widths inside the splitter
|
// Adjust the tableview widths inside the splitter
|
||||||
QList<int> sizeList;
|
QList<int> sizeList;
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
#include <components/fileorderlist/utils/lineedit.hpp>
|
#include <components/fileorderlist/utils/lineedit.hpp>
|
||||||
|
|
||||||
|
#include "components/fileorderlist/masterproxymodel.hpp"
|
||||||
|
|
||||||
FileDialog::FileDialog(QWidget *parent) :
|
FileDialog::FileDialog(QWidget *parent) :
|
||||||
QDialog(parent)
|
QDialog(parent)
|
||||||
{
|
{
|
||||||
@ -24,7 +26,7 @@ FileDialog::FileDialog(QWidget *parent) :
|
|||||||
// Models
|
// Models
|
||||||
mDataFilesModel = new DataFilesModel(this);
|
mDataFilesModel = new DataFilesModel(this);
|
||||||
|
|
||||||
mMastersProxyModel = new QSortFilterProxyModel();
|
mMastersProxyModel = new MasterProxyModel();
|
||||||
mMastersProxyModel->setFilterRegExp("game"); //QString("^.*\\.esm"));
|
mMastersProxyModel->setFilterRegExp("game"); //QString("^.*\\.esm"));
|
||||||
mMastersProxyModel->setFilterRole (Qt::UserRole);
|
mMastersProxyModel->setFilterRole (Qt::UserRole);
|
||||||
mMastersProxyModel->setSourceModel(mDataFilesModel);
|
mMastersProxyModel->setSourceModel(mDataFilesModel);
|
||||||
|
@ -70,6 +70,7 @@ find_package(Qt4 COMPONENTS QtCore QtGui)
|
|||||||
|
|
||||||
if(QT_QTGUI_LIBRARY AND QT_QTCORE_LIBRARY)
|
if(QT_QTGUI_LIBRARY AND QT_QTCORE_LIBRARY)
|
||||||
add_component_qt_dir (fileorderlist
|
add_component_qt_dir (fileorderlist
|
||||||
|
masterproxymodel
|
||||||
model/modelitem model/datafilesmodel model/pluginsproxymodel model/esm/esmfile
|
model/modelitem model/datafilesmodel model/pluginsproxymodel model/esm/esmfile
|
||||||
utils/profilescombobox utils/comboboxlineedit utils/lineedit utils/naturalsort
|
utils/profilescombobox utils/comboboxlineedit utils/lineedit utils/naturalsort
|
||||||
)
|
)
|
||||||
|
11
components/fileorderlist/masterproxymodel.cpp
Normal file
11
components/fileorderlist/masterproxymodel.cpp
Normal file
@ -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);
|
||||||
|
}
|
19
components/fileorderlist/masterproxymodel.hpp
Normal file
19
components/fileorderlist/masterproxymodel.hpp
Normal file
@ -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::data (index, role);
|
||||||
return QSortFilterProxyModel::headerData(section, orientation, role);
|
|
||||||
// return section + 1;
|
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ public:
|
|||||||
explicit PluginsProxyModel(QObject *parent = 0);
|
explicit PluginsProxyModel(QObject *parent = 0);
|
||||||
~PluginsProxyModel();
|
~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
|
#endif // PLUGINSPROXYMODEL_HPP
|
||||||
|
Loading…
x
Reference in New Issue
Block a user