1234567891011121314151617181920212223242526272829303132333435363738 |
- #ifndef FILEIO_H
- #define FILEIO_H
- #include <QObject>
- class FileIO : public QObject
- {
- Q_OBJECT
- public:
- Q_PROPERTY(QString source
- READ source
- WRITE setSource
- NOTIFY sourceChanged)
- explicit FileIO(QObject *parent = nullptr);
- Q_INVOKABLE QString read();
- Q_INVOKABLE bool write(const QString& data);
- Q_INVOKABLE bool remove(const QString& path);
- QString source() { return mSource; }
- public slots:
- void setSource(const QString& source) { mSource = source; }
- signals:
- void sourceChanged(const QString& source);
- void error(const QString& msg);
- private:
- QString mSource;
- signals:
- public slots:
- };
- #endif // FILEIO_H
|