summaryrefslogtreecommitdiffstats
path: root/examples/declarative/tutorials/gettingStarted/parts/part5/filedialog/directory.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/tutorials/gettingStarted/parts/part5/filedialog/directory.h')
-rw-r--r--examples/declarative/tutorials/gettingStarted/parts/part5/filedialog/directory.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/examples/declarative/tutorials/gettingStarted/parts/part5/filedialog/directory.h b/examples/declarative/tutorials/gettingStarted/parts/part5/filedialog/directory.h
index b5a7bbe1..a8997ee2 100644
--- a/examples/declarative/tutorials/gettingStarted/parts/part5/filedialog/directory.h
+++ b/examples/declarative/tutorials/gettingStarted/parts/part5/filedialog/directory.h
@@ -52,22 +52,22 @@
class Directory : public QObject{
Q_OBJECT
-
+
//number of files in the directory
Q_PROPERTY(int filesCount READ filesCount)
-
+
//list property containing file names as QString
Q_PROPERTY(QDeclarativeListProperty<File> files READ files CONSTANT )
-
+
//file name of the text file to read/write
Q_PROPERTY(QString filename READ filename WRITE setFilename NOTIFY filenameChanged)
-
+
//text content of the file
Q_PROPERTY(QString fileContent READ fileContent WRITE setFileContent NOTIFY fileContentChanged)
-
+
public:
Directory(QObject *parent = 0);
-
+
//properties' read functions
int filesCount() const;
QString filename() const;
@@ -77,30 +77,30 @@ class Directory : public QObject{
//properties' write functions
void setFilename(const QString &str);
void setFileContent(const QString &str);
-
+
//accessible from QML
Q_INVOKABLE void saveFile();
Q_INVOKABLE void loadFile();
-
+
signals:
void directoryChanged();
void filenameChanged();
void fileContentChanged();
-
+
private:
QDir m_dir;
- QStringList m_dirFiles;
- File currentFile;
+ QStringList m_dirFiles;
+ File currentFile;
QString m_saveDir;
- QStringList m_filterList;
-
+ QStringList m_filterList;
+
//contains the file data in QString format
QString m_fileContent;
-
+
//Registered to QML in a plugin. Accessible from QML as a property of Directory
QList<File *> m_fileList;
- //refresh content of the directory
+ //refresh content of the directory
void refresh();
};