Move the qt models to their own folder

Felt like the src folder was getting a bit crowded so move all the models to a folder named models.
This commit is contained in:
James Graham
2023-01-22 21:33:30 +00:00
parent 0af420b824
commit 594a5cf6ca
50 changed files with 51 additions and 51 deletions

37
src/models/statemodel.h Normal file
View File

@@ -0,0 +1,37 @@
// SPDX-FileCopyrightText: 2022 Tobias Fella <fella@posteo.de>
// SPDX-License-Identifier: LGPL-2.0-or-later
#pragma once
#include <QAbstractListModel>
#include "neochatroom.h"
class StateModel : public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY(NeoChatRoom *room READ room WRITE setRoom NOTIFY roomChanged)
public:
enum Roles {
TypeRole,
StateKeyRole,
SourceRole,
};
Q_ENUM(Roles);
StateModel(QObject *parent = nullptr);
QHash<int, QByteArray> roleNames() const override;
QVariant data(const QModelIndex &index, int role) const override;
int rowCount(const QModelIndex &parent) const override;
NeoChatRoom *room() const;
void setRoom(NeoChatRoom *room);
Q_SIGNALS:
void roomChanged();
private:
NeoChatRoom *m_room = nullptr;
};