mirror of https://github.com/OpenMW/openmw.git
Implementing delegate for referenceables table Type column
Added delegate skeleton class Added delegate creation code in ViewManager Added Display_RefRecordType enum to columnbase.hpp Changed Type column'sDisplay type to Display_RefRecordType in refidcollection.cpp modified OpenCS CMakeLists.txt to incorporate RefRecordTypeDelegate classpull/16/head
parent
6deddf7229
commit
9d95a38934
@ -0,0 +1,17 @@
|
||||
#include "refrecordtypedelegate.hpp"
|
||||
|
||||
CSVWorld::RefRecordTypeDelegate::RefRecordTypeDelegate
|
||||
(const std::vector<std::pair<int, QString> > &values, QUndoStack& undoStack, QObject *parent)
|
||||
: EnumDelegate (values, undoStack, parent)
|
||||
{}
|
||||
|
||||
CSVWorld::RefRecordTypeDelegateFactory::RefRecordTypeDelegateFactory()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CSVWorld::CommandDelegate *CSVWorld::RefRecordTypeDelegateFactory::makeDelegate (QUndoStack& undoStack,
|
||||
QObject *parent) const
|
||||
{
|
||||
return new RefRecordTypeDelegate (mValues, undoStack, parent);
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
#ifndef REFRECORDTYPEDELEGATE_HPP
|
||||
#define REFRECORDTYPEDELEGATE_HPP
|
||||
|
||||
#include "enumdelegate.hpp"
|
||||
#include "util.hpp"
|
||||
|
||||
namespace CSVWorld
|
||||
{
|
||||
class RefRecordTypeDelegate : public EnumDelegate
|
||||
{
|
||||
public:
|
||||
RefRecordTypeDelegate (const std::vector<std::pair<int, QString> > &mValues, QUndoStack& undoStack, QObject *parent);
|
||||
};
|
||||
|
||||
class RefRecordTypeDelegateFactory : public CommandDelegateFactory
|
||||
{
|
||||
|
||||
std::vector<std::pair<int, QString> > mValues;
|
||||
|
||||
public:
|
||||
RefRecordTypeDelegateFactory();
|
||||
|
||||
virtual CommandDelegate *makeDelegate (QUndoStack& undoStack, QObject *parent) const;
|
||||
///< The ownership of the returned CommandDelegate is transferred to the caller.
|
||||
};
|
||||
}
|
||||
/*
|
||||
class VarTypeDelegate : public EnumDelegate
|
||||
{
|
||||
private:
|
||||
|
||||
virtual void addCommands (QAbstractItemModel *model,
|
||||
const QModelIndex& index, int type) const;
|
||||
|
||||
public:
|
||||
|
||||
VarTypeDelegate (const std::vector<std::pair<int, QString> >& values,
|
||||
QUndoStack& undoStack, QObject *parent);
|
||||
};
|
||||
|
||||
class VarTypeDelegateFactory : public CommandDelegateFactory
|
||||
{
|
||||
std::vector<std::pair<int, QString> > mValues;
|
||||
|
||||
public:
|
||||
|
||||
VarTypeDelegateFactory (ESM::VarType type0 = ESM::VT_Unknown,
|
||||
ESM::VarType type1 = ESM::VT_Unknown, ESM::VarType type2 = ESM::VT_Unknown,
|
||||
ESM::VarType type3 = ESM::VT_Unknown);
|
||||
|
||||
virtual CommandDelegate *makeDelegate (QUndoStack& undoStack, QObject *parent) const;
|
||||
///< The ownership of the returned CommandDelegate is transferred to the caller.
|
||||
|
||||
void add (ESM::VarType type);
|
||||
};
|
||||
*/
|
||||
|
||||
#endif // REFRECORDTYPEDELEGATE_HPP
|
Loading…
Reference in New Issue