adding basic filemanager plumbing
This commit is contained in:
parent
04e3d95a0c
commit
e4d4cfe8c3
9 changed files with 121 additions and 3 deletions
38
src/filemanager.h
Normal file
38
src/filemanager.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
#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);
|
||||
|
||||
signals:
|
||||
Q_INVOKABLE void nameChanged(QString name);
|
||||
Q_INVOKABLE void filePathChanged(QString filePath);
|
||||
|
||||
private:
|
||||
QString m_name;
|
||||
QString m_filePath;
|
||||
};
|
||||
|
||||
#endif //FILEMANAGER_H
|
Loading…
Add table
Add a link
Reference in a new issue