moving code around for a better file structure

This commit is contained in:
Chris Cochrun 2022-12-09 10:55:50 -06:00
parent 8f3e898385
commit 7eba697dc2
27 changed files with 20 additions and 24 deletions

40
src/cpp/filemanager.h Normal file
View file

@ -0,0 +1,40 @@
#ifndef FILEMANAGER_H
#define FILEMANAGER_H
#include <qobjectdefs.h>
#include <qqml.h>
#include <QObject>
#include <qobject.h>
class File : public QObject
{
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(QString filePath READ filePath WRITE setFilePath NOTIFY filePathChanged)
// QML_ELEMENT
public:
explicit File(QObject *parent = nullptr);
File(const QString &name, const QString &filePath,
QObject * parent = nullptr);
QString name() const;
QString filePath() const;
Q_INVOKABLE void setName(QString name);
Q_INVOKABLE void setFilePath(QString filePath);
Q_INVOKABLE bool save(QUrl file, QVariantList serviceList);
Q_INVOKABLE QVariantList load(QUrl file);
signals:
Q_INVOKABLE void nameChanged(QString name);
Q_INVOKABLE void filePathChanged(QString filePath);
private:
QString m_name;
QString m_filePath;
};
#endif //FILEMANAGER_H