mirror of
https://github.com/obhq/obliteration.git
synced 2024-11-23 11:19:56 +00:00
22 lines
604 B
C++
22 lines
604 B
C++
#pragma once
|
|
|
|
#include "core.hpp"
|
|
|
|
#include <QAbstractListModel>
|
|
|
|
#include <vector>
|
|
|
|
class ProfileList final : public QAbstractListModel {
|
|
public:
|
|
ProfileList(QObject *parent = nullptr);
|
|
~ProfileList() override;
|
|
|
|
void add(Rust<Profile> &&p);
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
Profile *get(size_t i) const { return m_items[i]; }
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
|
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
|
|
private:
|
|
std::vector<Rust<Profile>> m_items;
|
|
};
|