diff options
Diffstat (limited to 'examples/tutorials/gettingStartedQml/parts/part5/filedialog')
7 files changed, 23 insertions, 23 deletions
diff --git a/examples/tutorials/gettingStartedQml/parts/part5/filedialog/dialogPlugin.cpp b/examples/tutorials/gettingStartedQml/parts/part5/filedialog/dialogPlugin.cpp index e4692b0a47..bd5c3f7428 100644 --- a/examples/tutorials/gettingStartedQml/parts/part5/filedialog/dialogPlugin.cpp +++ b/examples/tutorials/gettingStartedQml/parts/part5/filedialog/dialogPlugin.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: @@ -41,7 +41,7 @@ #include "dialogPlugin.h" #include "directory.h" #include "file.h" -#include <QtDeclarative/qdeclarative.h> +#include <QtQml/qqml.h> void DialogPlugin::registerTypes(const char *uri){ @@ -49,7 +49,7 @@ void DialogPlugin::registerTypes(const char *uri){ qmlRegisterType<Directory>(uri, 1, 0, "Directory"); qmlRegisterType<File>(uri,1,0,"File"); - //qRegisterMetaType<QDeclarativeListProperty<QString> > ("QDeclarativeListProperty<QString>"); + //qRegisterMetaType<QQmlListProperty<QString> > ("QQmlListProperty<QString>"); } diff --git a/examples/tutorials/gettingStartedQml/parts/part5/filedialog/dialogPlugin.h b/examples/tutorials/gettingStartedQml/parts/part5/filedialog/dialogPlugin.h index b46d252616..8d5459a543 100644 --- a/examples/tutorials/gettingStartedQml/parts/part5/filedialog/dialogPlugin.h +++ b/examples/tutorials/gettingStartedQml/parts/part5/filedialog/dialogPlugin.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: @@ -41,14 +41,14 @@ #ifndef DIALOGPLUGIN_H #define DIALOGPLUGIN_H -#include <QtDeclarative/QDeclarativeExtensionPlugin> +#include <QtQml/QQmlExtensionPlugin> -class DialogPlugin : public QDeclarativeExtensionPlugin +class DialogPlugin : public QQmlExtensionPlugin { Q_OBJECT public: - //registerTypes is inherited from QDeclarativeExtensionPlugin + //registerTypes is inherited from QQmlExtensionPlugin void registerTypes(const char *uri); }; diff --git a/examples/tutorials/gettingStartedQml/parts/part5/filedialog/directory.cpp b/examples/tutorials/gettingStartedQml/parts/part5/filedialog/directory.cpp index b2984d3c2d..2247360017 100644 --- a/examples/tutorials/gettingStartedQml/parts/part5/filedialog/directory.cpp +++ b/examples/tutorials/gettingStartedQml/parts/part5/filedialog/directory.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: @@ -74,39 +74,39 @@ int Directory:: filesCount() const{ /* Function called to append data onto list property */ -void appendFiles(QDeclarativeListProperty<File> * property, File * file){ +void appendFiles(QQmlListProperty<File> * property, File * file){ //Do nothing. can't add to a directory using this method } /* Function called to retrieve file in the list using an index */ -File* fileAt(QDeclarativeListProperty<File> * property, int index){ +File* fileAt(QQmlListProperty<File> * property, int index){ return static_cast< QList<File *> *>(property->data)->at(index); } /* Returns the number of files in the list */ -int filesSize(QDeclarativeListProperty<File> * property){ +int filesSize(QQmlListProperty<File> * property){ return static_cast< QList<File *> *>(property->data)->size(); } /* Function called to empty the list property contents */ -void clearFilesPtr(QDeclarativeListProperty<File> *property){ +void clearFilesPtr(QQmlListProperty<File> *property){ return static_cast< QList<File *> *>(property->data)->clear(); } /* -Returns the list of files as a QDeclarativeListProperty. +Returns the list of files as a QQmlListProperty. */ -QDeclarativeListProperty<File> Directory::files(){ +QQmlListProperty<File> Directory::files(){ refresh(); -// return QDeclarativeListProperty<QString>(this,m_filePtrList); //not recommended in the docs - return QDeclarativeListProperty<File>( this, &m_fileList, &appendFiles, &filesSize, &fileAt, &clearFilesPtr ); +// return QQmlListProperty<QString>(this,m_filePtrList); //not recommended in the docs + return QQmlListProperty<File>( this, &m_fileList, &appendFiles, &filesSize, &fileAt, &clearFilesPtr ); } /* diff --git a/examples/tutorials/gettingStartedQml/parts/part5/filedialog/directory.h b/examples/tutorials/gettingStartedQml/parts/part5/filedialog/directory.h index 53872f257b..a47e9e112f 100644 --- a/examples/tutorials/gettingStartedQml/parts/part5/filedialog/directory.h +++ b/examples/tutorials/gettingStartedQml/parts/part5/filedialog/directory.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: @@ -46,7 +46,7 @@ #include <QDir> #include <QStringList> #include <QTextStream> -#include <QDeclarativeListProperty> +#include <QQmlListProperty> #include <QObject> class Directory : public QObject{ @@ -57,7 +57,7 @@ class Directory : public QObject{ Q_PROPERTY(int filesCount READ filesCount) //list property containing file names as QString - Q_PROPERTY(QDeclarativeListProperty<File> files READ files CONSTANT ) + Q_PROPERTY(QQmlListProperty<File> files READ files CONSTANT ) //file name of the text file to read/write Q_PROPERTY(QString filename READ filename WRITE setFilename NOTIFY filenameChanged) @@ -72,7 +72,7 @@ class Directory : public QObject{ int filesCount() const; QString filename() const; QString fileContent() const; - QDeclarativeListProperty<File> files(); + QQmlListProperty<File> files(); //properties' write functions void setFilename(const QString &str); diff --git a/examples/tutorials/gettingStartedQml/parts/part5/filedialog/file.cpp b/examples/tutorials/gettingStartedQml/parts/part5/filedialog/file.cpp index c1b57297cf..2385ed3240 100644 --- a/examples/tutorials/gettingStartedQml/parts/part5/filedialog/file.cpp +++ b/examples/tutorials/gettingStartedQml/parts/part5/filedialog/file.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: diff --git a/examples/tutorials/gettingStartedQml/parts/part5/filedialog/file.h b/examples/tutorials/gettingStartedQml/parts/part5/filedialog/file.h index d57595607c..251b45282d 100644 --- a/examples/tutorials/gettingStartedQml/parts/part5/filedialog/file.h +++ b/examples/tutorials/gettingStartedQml/parts/part5/filedialog/file.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: diff --git a/examples/tutorials/gettingStartedQml/parts/part5/filedialog/filedialog.pro b/examples/tutorials/gettingStartedQml/parts/part5/filedialog/filedialog.pro index 6247747003..71abddc7e3 100644 --- a/examples/tutorials/gettingStartedQml/parts/part5/filedialog/filedialog.pro +++ b/examples/tutorials/gettingStartedQml/parts/part5/filedialog/filedialog.pro @@ -1,6 +1,6 @@ TEMPLATE = lib CONFIG += qt plugin -QT += declarative +QT += qml DESTDIR += ../plugins OBJECTS_DIR = tmp |