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

39 lines
889 B
C
Raw Normal View History

2016-03-05 11:35:32 +00:00
#ifndef PROFILESMODEL_H
#define PROFILESMODEL_H
#include "configfile.h"
2016-03-12 20:56:23 +00:00
/**
* Profiles model
*
* \author Cedric 'Kervala' OCHS
* \date 2016
*/
2016-03-05 11:35:32 +00:00
class CProfilesModel : public QAbstractListModel
{
2016-08-14 10:50:29 +00:00
Q_OBJECT
2016-03-05 11:35:32 +00:00
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 14:59:21 +00:00
bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex());
2016-03-05 11:35:32 +00:00
bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
CProfiles& getProfiles() { return m_profiles; }
bool save() const;
2016-05-16 12:45:43 +00:00
int getIndexFromProfileID(const QString &profileId) const;
QString getProfileIDFromIndex(int index) const;
2016-03-05 11:35:32 +00:00
private:
CProfiles m_profiles;
};
#endif