diff options
author | Topi Reinio <topi.reinio@digia.com> | 2013-08-01 11:39:02 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-09 15:47:23 +0200 |
commit | fc8b40f888139342ebe0d4ce7d507005572737db (patch) | |
tree | e90b81b9922fcb1b615d131a487c282cc3a45841 /examples/quick/tutorials/gettingStartedQml/filedialog/directory.h | |
parent | 04f699d26a3f06dbd98d9bd3e0f64ee9980a6a26 (diff) |
Doc: Update example used for QML getting started tutorial
Update the example project referred to in Getting Started with Qt
Quick tutorial.
- Fix coding/comment style issues
- Change plugin TARGET name, Use /imports as the
destination directory
- Fix qmldir with proper module info, delete unused
qmldir from /core
- Add a .qmlproject file
Change-Id: If269e61fb76399faae753469dc251d07cc219139
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Diffstat (limited to 'examples/quick/tutorials/gettingStartedQml/filedialog/directory.h')
-rw-r--r-- | examples/quick/tutorials/gettingStartedQml/filedialog/directory.h | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/examples/quick/tutorials/gettingStartedQml/filedialog/directory.h b/examples/quick/tutorials/gettingStartedQml/filedialog/directory.h index 2cdfab0e43..de170f28b0 100644 --- a/examples/quick/tutorials/gettingStartedQml/filedialog/directory.h +++ b/examples/quick/tutorials/gettingStartedQml/filedialog/directory.h @@ -44,41 +44,40 @@ #include "file.h" #include <QDir> -#include <QObject> -#include <QQmlListProperty> #include <QStringList> #include <QTextStream> +#include <QQmlListProperty> +#include <QObject> -class Directory : public QObject -{ +class Directory : public QObject { Q_OBJECT - // number of files in the directory + // Number of files in the directory Q_PROPERTY(int filesCount READ filesCount) - // list property containing file names as QString + // List property containing file names as QString Q_PROPERTY(QQmlListProperty<File> files READ files CONSTANT) - // file name of the text file to read/write + // File name of the text file to read/write Q_PROPERTY(QString filename READ filename WRITE setFilename NOTIFY filenameChanged) - // text content of the file + // Text content of the file Q_PROPERTY(QString fileContent READ fileContent WRITE setFileContent NOTIFY fileContentChanged) public: Directory(QObject *parent = 0); - // properties' read functions + // Properties' read functions int filesCount() const; QString filename() const; QString fileContent() const; QQmlListProperty<File> files(); - // properties' write functions + // Properties' write functions void setFilename(const QString &str); void setFileContent(const QString &str); - // accessible from QML + // Accessible from QML Q_INVOKABLE void saveFile(); Q_INVOKABLE void loadFile(); @@ -94,13 +93,13 @@ private: QString m_saveDir; QStringList m_filterList; - //contains the file data in QString format + // Contains the file data in QString format QString m_fileContent; - //Registered to QML in a plugin. Accessible from QML as a property of Directory + // 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(); }; |