khanat-code-old/code/ryzom/tools/client/ryzom_installer/src/profilesmodel.h

37 lines
878 B
C
Raw Normal View History

2016-05-14 16:55:54 +00:00
#ifndef PROFILESMODEL_H
#define PROFILESMODEL_H
#include "configfile.h"
/**
* Profiles model
*
* \author Cedric 'Kervala' OCHS
* \date 2016
*/
class CProfilesModel : public QAbstractListModel
{
public:
CProfilesModel(QObject *parent);
CProfilesModel(const CProfiles &profiles, QObject *parent);
virtual ~CProfilesModel();
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
2016-06-11 15:06:08 +00:00
bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex());
2016-05-14 16:55:54 +00:00
bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
CProfiles& getProfiles() { return m_profiles; }
bool save() const;
2016-05-16 14:31:30 +00:00
int getIndexFromProfileID(const QString &profileId) const;
QString getProfileIDFromIndex(int index) const;
2016-05-14 16:55:54 +00:00
private:
CProfiles m_profiles;
};
#endif