summaryrefslogtreecommitdiffstats
path: root/src/declarative/extra
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2009-11-02 01:25:49 (GMT)
committerBea Lam <bea.lam@nokia.com>2009-11-02 01:25:49 (GMT)
commit93b624c74f0486330c1e8f3aa3fe2b24d95f54b5 (patch)
tree1845655a9228da064d7e6e3630f073de37f77a65 /src/declarative/extra
parent837f5d2385e413b89e78cd487f5a3f818c179292 (diff)
parentd01db18696a7729b0d54af76f5224aed6750f3bb (diff)
downloadQt-93b624c74f0486330c1e8f3aa3fe2b24d95f54b5.zip
Qt-93b624c74f0486330c1e8f3aa3fe2b24d95f54b5.tar.gz
Qt-93b624c74f0486330c1e8f3aa3fe2b24d95f54b5.tar.bz2
Merge branch 'kinetic-declarativeui' of scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/extra')
-rw-r--r--src/declarative/extra/extra.pri34
-rw-r--r--src/declarative/extra/qmlbehavior.cpp38
-rw-r--r--src/declarative/extra/qmlbehavior_p.h (renamed from src/declarative/extra/qmlbehavior.h)34
-rw-r--r--src/declarative/extra/qmldatetimeformatter.cpp34
-rw-r--r--src/declarative/extra/qmldatetimeformatter_p.h (renamed from src/declarative/extra/qmldatetimeformatter.h)32
-rw-r--r--src/declarative/extra/qmlfontloader.cpp34
-rw-r--r--src/declarative/extra/qmlfontloader_p.h (renamed from src/declarative/extra/qmlfontloader.h)32
-rw-r--r--src/declarative/extra/qmlgraphicsanimatedimageitem.cpp (renamed from src/declarative/extra/qfxanimatedimageitem.cpp)98
-rw-r--r--src/declarative/extra/qmlgraphicsanimatedimageitem_p.h (renamed from src/declarative/extra/qfxanimatedimageitem.h)56
-rw-r--r--src/declarative/extra/qmlgraphicsanimatedimageitem_p_p.h (renamed from src/declarative/extra/qfxanimatedimageitem_p.h)46
-rw-r--r--src/declarative/extra/qmlgraphicsintegermodel.cpp (renamed from src/declarative/extra/qfxintegermodel.cpp)62
-rw-r--r--src/declarative/extra/qmlgraphicsintegermodel_p.h (renamed from src/declarative/extra/qfxintegermodel.h)50
-rw-r--r--src/declarative/extra/qmlgraphicsparticles.cpp (renamed from src/declarative/extra/qfxparticles.cpp)368
-rw-r--r--src/declarative/extra/qmlgraphicsparticles_p.h (renamed from src/declarative/extra/qfxparticles.h)112
-rw-r--r--src/declarative/extra/qmlnumberformatter.cpp34
-rw-r--r--src/declarative/extra/qmlnumberformatter_p.h (renamed from src/declarative/extra/qmlnumberformatter.h)34
-rw-r--r--src/declarative/extra/qmlsqlconnection.cpp429
-rw-r--r--src/declarative/extra/qmlsqlconnection.h116
-rw-r--r--src/declarative/extra/qmlsqlquery.cpp788
-rw-r--r--src/declarative/extra/qmlsqlquery.h143
-rw-r--r--src/declarative/extra/qmlxmllistmodel.cpp38
-rw-r--r--src/declarative/extra/qmlxmllistmodel_p.h (renamed from src/declarative/extra/qmlxmllistmodel.h)36
-rw-r--r--src/declarative/extra/qnumberformat.cpp34
-rw-r--r--src/declarative/extra/qnumberformat_p.h (renamed from src/declarative/extra/qnumberformat.h)32
24 files changed, 615 insertions, 2099 deletions
diff --git a/src/declarative/extra/extra.pri b/src/declarative/extra/extra.pri
index 502504a..9d0e760 100644
--- a/src/declarative/extra/extra.pri
+++ b/src/declarative/extra/extra.pri
@@ -2,34 +2,26 @@ SOURCES += \
extra/qnumberformat.cpp \
extra/qmlnumberformatter.cpp \
extra/qmldatetimeformatter.cpp \
- extra/qfxintegermodel.cpp \
- extra/qfxanimatedimageitem.cpp \
- extra/qfxparticles.cpp \
+ extra/qmlgraphicsintegermodel.cpp \
+ extra/qmlgraphicsanimatedimageitem.cpp \
+ extra/qmlgraphicsparticles.cpp \
extra/qmlbehavior.cpp \
extra/qmlfontloader.cpp
HEADERS += \
- extra/qnumberformat.h \
- extra/qmlnumberformatter.h \
- extra/qmldatetimeformatter.h \
- extra/qfxintegermodel.h \
- extra/qfxanimatedimageitem.h \
- extra/qfxanimatedimageitem_p.h \
- extra/qfxparticles.h \
- extra/qmlbehavior.h \
- extra/qmlfontloader.h
+ extra/qnumberformat_p.h \
+ extra/qmlnumberformatter_p.h \
+ extra/qmldatetimeformatter_p.h \
+ extra/qmlgraphicsintegermodel_p.h \
+ extra/qmlgraphicsanimatedimageitem_p.h \
+ extra/qmlgraphicsanimatedimageitem_p_p.h \
+ extra/qmlgraphicsparticles_p.h \
+ extra/qmlbehavior_p.h \
+ extra/qmlfontloader_p.h
contains(QT_CONFIG, xmlpatterns) {
QT+=xmlpatterns
SOURCES += extra/qmlxmllistmodel.cpp
- HEADERS += extra/qmlxmllistmodel.h
+ HEADERS += extra/qmlxmllistmodel_p.h
}
-# SQL is permanently enabled :-/
-#contains(QT_CONFIG, sql) {
- QT+= sql
- SOURCES += extra/qmlsqlquery.cpp \
- extra/qmlsqlconnection.cpp
- HEADERS += extra/qmlsqlquery.h \
- extra/qmlsqlconnection.h
-#}
diff --git a/src/declarative/extra/qmlbehavior.cpp b/src/declarative/extra/qmlbehavior.cpp
index 654cb4e..d6f4b42 100644
--- a/src/declarative/extra/qmlbehavior.cpp
+++ b/src/declarative/extra/qmlbehavior.cpp
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,29 +21,28 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
#include <private/qobject_p.h>
-#include "qmlanimation.h"
-#include "qmltransition.h"
-#include "qmlbehavior.h"
+#include <private/qmlanimation_p.h>
+#include <private/qmltransition_p.h>
+#include "qmlbehavior_p.h"
#include <QtDeclarative/qmlcontext.h>
#include <QtDeclarative/qmlinfo.h>
#include <QtCore/qparallelanimationgroup.h>
diff --git a/src/declarative/extra/qmlbehavior.h b/src/declarative/extra/qmlbehavior_p.h
index 6508455..9f85f84 100644
--- a/src/declarative/extra/qmlbehavior.h
+++ b/src/declarative/extra/qmlbehavior_p.h
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,21 +21,20 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -45,7 +45,7 @@
#include <QtDeclarative/qmlpropertyvaluesource.h>
#include <QtDeclarative/qmlpropertyvalueinterceptor.h>
#include <QtDeclarative/qml.h>
-#include <QtDeclarative/qmlstate.h>
+#include <private/qmlstate_p.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/extra/qmldatetimeformatter.cpp b/src/declarative/extra/qmldatetimeformatter.cpp
index 9b3d37a..4441850 100644
--- a/src/declarative/extra/qmldatetimeformatter.cpp
+++ b/src/declarative/extra/qmldatetimeformatter.cpp
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,26 +21,25 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "qmldatetimeformatter.h"
+#include "qmldatetimeformatter_p.h"
#include "private/qobject_p.h"
#include <QtCore/qlocale.h>
diff --git a/src/declarative/extra/qmldatetimeformatter.h b/src/declarative/extra/qmldatetimeformatter_p.h
index be0ae02..e350f96 100644
--- a/src/declarative/extra/qmldatetimeformatter.h
+++ b/src/declarative/extra/qmldatetimeformatter_p.h
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,21 +21,20 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/declarative/extra/qmlfontloader.cpp b/src/declarative/extra/qmlfontloader.cpp
index f9857f6..8c17d0f 100644
--- a/src/declarative/extra/qmlfontloader.cpp
+++ b/src/declarative/extra/qmlfontloader.cpp
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,27 +21,26 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
#include "private/qobject_p.h"
-#include "qmlfontloader.h"
+#include "qmlfontloader_p.h"
#include <QUrl>
#include <QDebug>
#include <QNetworkRequest>
diff --git a/src/declarative/extra/qmlfontloader.h b/src/declarative/extra/qmlfontloader_p.h
index c2c7a16..d02a181 100644
--- a/src/declarative/extra/qmlfontloader.h
+++ b/src/declarative/extra/qmlfontloader_p.h
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,21 +21,20 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/declarative/extra/qfxanimatedimageitem.cpp b/src/declarative/extra/qmlgraphicsanimatedimageitem.cpp
index 5a491e0..5dbffc0 100644
--- a/src/declarative/extra/qfxanimatedimageitem.cpp
+++ b/src/declarative/extra/qmlgraphicsanimatedimageitem.cpp
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,21 +21,20 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,20 +42,20 @@
#include <QMovie>
#include <QtDeclarative/qmlcontext.h>
#include <QtDeclarative/qmlengine.h>
-#include "qfxanimatedimageitem.h"
-#include "qfxanimatedimageitem_p.h"
+#include "qmlgraphicsanimatedimageitem_p.h"
+#include "qmlgraphicsanimatedimageitem_p_p.h"
#include <QNetworkRequest>
#include <QNetworkReply>
QT_BEGIN_NAMESPACE
/*!
- \class QFxAnimatedImageItem
+ \class QmlGraphicsAnimatedImageItem
\internal
*/
/*!
- \qmlclass AnimatedImage
+ \qmlclass AnimatedImage QFxAnimatedImageItem
\inherits Image
This item provides for playing animations stored as images containing a series of frames,
@@ -77,21 +77,21 @@ Item {
\endqml
\endtable
*/
-QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,AnimatedImage,QFxAnimatedImageItem)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,AnimatedImage,QmlGraphicsAnimatedImageItem)
-QFxAnimatedImageItem::QFxAnimatedImageItem(QFxItem *parent)
- : QFxImage(*(new QFxAnimatedImageItemPrivate), parent)
+QmlGraphicsAnimatedImageItem::QmlGraphicsAnimatedImageItem(QmlGraphicsItem *parent)
+ : QmlGraphicsImage(*(new QmlGraphicsAnimatedImageItemPrivate), parent)
{
}
-QFxAnimatedImageItem::QFxAnimatedImageItem(QFxAnimatedImageItemPrivate &dd, QFxItem *parent)
- : QFxImage(dd, parent)
+QmlGraphicsAnimatedImageItem::QmlGraphicsAnimatedImageItem(QmlGraphicsAnimatedImageItemPrivate &dd, QmlGraphicsItem *parent)
+ : QmlGraphicsImage(dd, parent)
{
}
-QFxAnimatedImageItem::~QFxAnimatedImageItem()
+QmlGraphicsAnimatedImageItem::~QmlGraphicsAnimatedImageItem()
{
- Q_D(QFxAnimatedImageItem);
+ Q_D(QmlGraphicsAnimatedImageItem);
delete d->_movie;
}
@@ -101,17 +101,17 @@ QFxAnimatedImageItem::~QFxAnimatedImageItem()
Defaults to false, and can be set to true when you want to pause.
*/
-bool QFxAnimatedImageItem::isPaused() const
+bool QmlGraphicsAnimatedImageItem::isPaused() const
{
- Q_D(const QFxAnimatedImageItem);
+ Q_D(const QmlGraphicsAnimatedImageItem);
if(!d->_movie)
return false;
return d->_movie->state()==QMovie::Paused;
}
-void QFxAnimatedImageItem::setPaused(bool pause)
+void QmlGraphicsAnimatedImageItem::setPaused(bool pause)
{
- Q_D(QFxAnimatedImageItem);
+ Q_D(QmlGraphicsAnimatedImageItem);
if(pause == d->paused)
return;
d->paused = pause;
@@ -125,17 +125,17 @@ void QFxAnimatedImageItem::setPaused(bool pause)
Defaults to true, so as to start playing immediately.
*/
-bool QFxAnimatedImageItem::isPlaying() const
+bool QmlGraphicsAnimatedImageItem::isPlaying() const
{
- Q_D(const QFxAnimatedImageItem);
+ Q_D(const QmlGraphicsAnimatedImageItem);
if (!d->_movie)
return false;
return d->_movie->state()!=QMovie::NotRunning;
}
-void QFxAnimatedImageItem::setPlaying(bool play)
+void QmlGraphicsAnimatedImageItem::setPlaying(bool play)
{
- Q_D(QFxAnimatedImageItem);
+ Q_D(QmlGraphicsAnimatedImageItem);
if(play == d->playing)
return;
d->playing = play;
@@ -155,33 +155,33 @@ void QFxAnimatedImageItem::setPlaying(bool play)
allow other things to animate at the same time as the image. frameCount is the number
of frames in the animation. For some animation formats, frameCount is unknown and set to zero.
*/
-int QFxAnimatedImageItem::currentFrame() const
+int QmlGraphicsAnimatedImageItem::currentFrame() const
{
- Q_D(const QFxAnimatedImageItem);
+ Q_D(const QmlGraphicsAnimatedImageItem);
if (!d->_movie)
return -1;
return d->_movie->currentFrameNumber();
}
-void QFxAnimatedImageItem::setCurrentFrame(int frame)
+void QmlGraphicsAnimatedImageItem::setCurrentFrame(int frame)
{
- Q_D(QFxAnimatedImageItem);
+ Q_D(QmlGraphicsAnimatedImageItem);
if (!d->_movie)
return;
d->_movie->jumpToFrame(frame);
}
-int QFxAnimatedImageItem::frameCount() const
+int QmlGraphicsAnimatedImageItem::frameCount() const
{
- Q_D(const QFxAnimatedImageItem);
+ Q_D(const QmlGraphicsAnimatedImageItem);
if (!d->_movie)
return 0;
return d->_movie->frameCount();
}
-void QFxAnimatedImageItem::setSource(const QUrl &url)
+void QmlGraphicsAnimatedImageItem::setSource(const QUrl &url)
{
- Q_D(QFxAnimatedImageItem);
+ Q_D(QmlGraphicsAnimatedImageItem);
if (url == d->url)
return;
@@ -209,9 +209,9 @@ void QFxAnimatedImageItem::setSource(const QUrl &url)
emit statusChanged(d->status);
}
-void QFxAnimatedImageItem::movieRequestFinished()
+void QmlGraphicsAnimatedImageItem::movieRequestFinished()
{
- Q_D(QFxAnimatedImageItem);
+ Q_D(QmlGraphicsAnimatedImageItem);
d->_movie = new QMovie(d->reply);
if (!d->_movie->isValid()){
qWarning() << "Error Reading Animated Image File " << d->url;
@@ -233,16 +233,16 @@ void QFxAnimatedImageItem::movieRequestFinished()
setPixmap(d->_movie->currentPixmap());
}
-void QFxAnimatedImageItem::movieUpdate()
+void QmlGraphicsAnimatedImageItem::movieUpdate()
{
- Q_D(QFxAnimatedImageItem);
+ Q_D(QmlGraphicsAnimatedImageItem);
setPixmap(d->_movie->currentPixmap());
emit frameChanged();
}
-void QFxAnimatedImageItem::playingStatusChanged()
+void QmlGraphicsAnimatedImageItem::playingStatusChanged()
{
- Q_D(QFxAnimatedImageItem);
+ Q_D(QmlGraphicsAnimatedImageItem);
if((d->_movie->state() != QMovie::NotRunning) != d->playing){
d->playing = (d->_movie->state() != QMovie::NotRunning);
emit playingChanged();
diff --git a/src/declarative/extra/qfxanimatedimageitem.h b/src/declarative/extra/qmlgraphicsanimatedimageitem_p.h
index 4002a3f..097aecd 100644
--- a/src/declarative/extra/qfxanimatedimageitem.h
+++ b/src/declarative/extra/qmlgraphicsanimatedimageitem_p.h
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,29 +21,28 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef QFXANIMATEDIMAGEITEM_H
-#define QFXANIMATEDIMAGEITEM_H
+#ifndef QMLGRAPHICSANIMATEDIMAGEITEM_H
+#define QMLGRAPHICSANIMATEDIMAGEITEM_H
-#include <QtDeclarative/qfximage.h>
+#include <private/qmlgraphicsimage_p.h>
QT_BEGIN_HEADER
@@ -51,9 +51,9 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QMovie;
-class QFxAnimatedImageItemPrivate;
+class QmlGraphicsAnimatedImageItemPrivate;
-class Q_DECLARATIVE_EXPORT QFxAnimatedImageItem : public QFxImage
+class Q_DECLARATIVE_EXPORT QmlGraphicsAnimatedImageItem : public QmlGraphicsImage
{
Q_OBJECT
@@ -62,8 +62,8 @@ class Q_DECLARATIVE_EXPORT QFxAnimatedImageItem : public QFxImage
Q_PROPERTY(int currentFrame READ currentFrame WRITE setCurrentFrame NOTIFY frameChanged)
Q_PROPERTY(int frameCount READ frameCount)
public:
- QFxAnimatedImageItem(QFxItem *parent=0);
- ~QFxAnimatedImageItem();
+ QmlGraphicsAnimatedImageItem(QmlGraphicsItem *parent=0);
+ ~QmlGraphicsAnimatedImageItem();
bool isPlaying() const;
void setPlaying(bool play);
@@ -76,7 +76,7 @@ public:
int frameCount() const;
- // Extends QFxImage's src property*/
+ // Extends QmlGraphicsImage's src property*/
virtual void setSource(const QUrl&);
Q_SIGNALS:
@@ -90,16 +90,16 @@ private Q_SLOTS:
void playingStatusChanged();
protected:
- QFxAnimatedImageItem(QFxAnimatedImageItemPrivate &dd, QFxItem *parent);
+ QmlGraphicsAnimatedImageItem(QmlGraphicsAnimatedImageItemPrivate &dd, QmlGraphicsItem *parent);
private:
- Q_DISABLE_COPY(QFxAnimatedImageItem)
- Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QFxAnimatedImageItem)
+ Q_DISABLE_COPY(QmlGraphicsAnimatedImageItem)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsAnimatedImageItem)
};
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QFxAnimatedImageItem)
+QML_DECLARE_TYPE(QmlGraphicsAnimatedImageItem)
QT_END_HEADER
diff --git a/src/declarative/extra/qfxanimatedimageitem_p.h b/src/declarative/extra/qmlgraphicsanimatedimageitem_p_p.h
index 56252ca..0b12d2f 100644
--- a/src/declarative/extra/qfxanimatedimageitem_p.h
+++ b/src/declarative/extra/qmlgraphicsanimatedimageitem_p_p.h
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,27 +21,26 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef QFXANIMATEDIMAGE_P_H
-#define QFXANIMATEDIMAGE_P_H
+#ifndef QMLGRAPHICSANIMATEDIMAGE_P_H
+#define QMLGRAPHICSANIMATEDIMAGE_P_H
//
// W A R N I N G
@@ -53,19 +53,19 @@
// We mean it.
//
-#include <private/qfximage_p.h>
+#include <private/qmlgraphicsimage_p_p.h>
QT_BEGIN_NAMESPACE
class QMovie;
class QNetworkReply;
-class QFxAnimatedImageItemPrivate : public QFxImagePrivate
+class QmlGraphicsAnimatedImageItemPrivate : public QmlGraphicsImagePrivate
{
- Q_DECLARE_PUBLIC(QFxAnimatedImageItem)
+ Q_DECLARE_PUBLIC(QmlGraphicsAnimatedImageItem)
public:
- QFxAnimatedImageItemPrivate()
+ QmlGraphicsAnimatedImageItemPrivate()
: playing(true), paused(false), _movie(0), reply(0)
{
}
@@ -78,4 +78,4 @@ public:
QT_END_NAMESPACE
-#endif // QFXANIMATEDIMAGE_P_H
+#endif // QMLGRAPHICSANIMATEDIMAGE_P_H
diff --git a/src/declarative/extra/qfxintegermodel.cpp b/src/declarative/extra/qmlgraphicsintegermodel.cpp
index 3cd46d7..bcd00e6 100644
--- a/src/declarative/extra/qfxintegermodel.cpp
+++ b/src/declarative/extra/qmlgraphicsintegermodel.cpp
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,76 +21,75 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "qfxintegermodel.h"
+#include "qmlgraphicsintegermodel_p.h"
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,IntegerModel,QFxIntegerModel)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,IntegerModel,QmlGraphicsIntegerModel)
-class QFxIntegerModelPrivate
+class QmlGraphicsIntegerModelPrivate
{
public:
- QFxIntegerModelPrivate() : minimum(0), maximum(0) {}
+ QmlGraphicsIntegerModelPrivate() : minimum(0), maximum(0) {}
int minimum;
int maximum;
};
-QFxIntegerModel::QFxIntegerModel(QObject *parent)
+QmlGraphicsIntegerModel::QmlGraphicsIntegerModel(QObject *parent)
: QListModelInterface(parent)
{
- d = new QFxIntegerModelPrivate;
+ d = new QmlGraphicsIntegerModelPrivate;
}
-QFxIntegerModel::~QFxIntegerModel()
+QmlGraphicsIntegerModel::~QmlGraphicsIntegerModel()
{
delete d;
}
-int QFxIntegerModel::minimum() const
+int QmlGraphicsIntegerModel::minimum() const
{
return d->minimum;
}
-void QFxIntegerModel::setMinimum(int minimum)
+void QmlGraphicsIntegerModel::setMinimum(int minimum)
{
d->minimum = minimum;
}
-int QFxIntegerModel::maximum() const
+int QmlGraphicsIntegerModel::maximum() const
{
return d->maximum;
}
-void QFxIntegerModel::setMaximum(int maximum)
+void QmlGraphicsIntegerModel::setMaximum(int maximum)
{
d->maximum = maximum;
}
-int QFxIntegerModel::count() const
+int QmlGraphicsIntegerModel::count() const
{
return qMax(0, d->maximum - d->minimum + 1);
}
-QHash<int,QVariant> QFxIntegerModel::data(int index, const QList<int> &roles) const
+QHash<int,QVariant> QmlGraphicsIntegerModel::data(int index, const QList<int> &roles) const
{
QHash<int,QVariant> returnHash;
@@ -108,7 +108,7 @@ QHash<int,QVariant> QFxIntegerModel::data(int index, const QList<int> &roles) co
return returnHash;
}
-QString QFxIntegerModel::toString(int role) const
+QString QmlGraphicsIntegerModel::toString(int role) const
{
switch(role) {
case Qt::DisplayRole:
@@ -118,7 +118,7 @@ QString QFxIntegerModel::toString(int role) const
}
}
-QList<int> QFxIntegerModel::roles() const
+QList<int> QmlGraphicsIntegerModel::roles() const
{
return QList<int>() << Qt::DisplayRole;
}
diff --git a/src/declarative/extra/qfxintegermodel.h b/src/declarative/extra/qmlgraphicsintegermodel_p.h
index 7fced2c..4055e01 100644
--- a/src/declarative/extra/qfxintegermodel.h
+++ b/src/declarative/extra/qmlgraphicsintegermodel_p.h
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,31 +21,30 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef QFXINTMODEL_H
-#define QFXINTMODEL_H
+#ifndef QMLGRAPHICSINTMODEL_H
+#define QMLGRAPHICSINTMODEL_H
#include <QtCore/QObject>
#include <QtDeclarative/qml.h>
-#include <QtDeclarative/qlistmodelinterface.h>
+#include <private/qlistmodelinterface_p.h>
QT_BEGIN_HEADER
@@ -52,13 +52,13 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
-class QFxIntegerModelPrivate;
-class Q_DECLARATIVE_EXPORT QFxIntegerModel : public QListModelInterface
+class QmlGraphicsIntegerModelPrivate;
+class Q_DECLARATIVE_EXPORT QmlGraphicsIntegerModel : public QListModelInterface
{
Q_OBJECT
public:
- QFxIntegerModel(QObject *parent=0);
- ~QFxIntegerModel();
+ QmlGraphicsIntegerModel(QObject *parent=0);
+ ~QmlGraphicsIntegerModel();
Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
int minimum() const;
@@ -74,12 +74,12 @@ public:
QString toString(int role) const;
private:
- QFxIntegerModelPrivate *d;
+ QmlGraphicsIntegerModelPrivate *d;
};
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QFxIntegerModel)
+QML_DECLARE_TYPE(QmlGraphicsIntegerModel)
QT_END_HEADER
diff --git a/src/declarative/extra/qfxparticles.cpp b/src/declarative/extra/qmlgraphicsparticles.cpp
index 8e77c34..aba7e27 100644
--- a/src/declarative/extra/qfxparticles.cpp
+++ b/src/declarative/extra/qmlgraphicsparticles.cpp
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,26 +21,25 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "private/qfxitem_p.h"
+#include "private/qmlgraphicsitem_p.h"
#include <stdlib.h>
#include <math.h>
@@ -50,12 +50,12 @@
#ifndef INT_MAX
#define INT_MAX 2147483647
#endif
-#include <qfxpixmapcache.h>
-#include <private/qfxperf_p.h>
-#include <private/qmlanimation_p.h>
+#include <private/qmlgraphicspixmapcache_p.h>
+#include <private/qfxperf_p_p.h>
+#include <private/qmlanimation_p_p.h>
#include <QNetworkReply>
-#include "qfxparticles.h"
+#include "qmlgraphicsparticles_p.h"
#include <QPainter>
#include <QtGui/qdrawutil.h>
#include <QVarLengthArray>
@@ -81,10 +81,10 @@ inline qreal fastCos(qreal theta)
return fastSin(theta);
}
-class QFxParticle
+class QmlGraphicsParticle
{
public:
- QFxParticle(int time) : lifeSpan(1000), fadeOutAge(800)
+ QmlGraphicsParticle(int time) : lifeSpan(1000), fadeOutAge(800)
, opacity(0), birthTime(time), x_velocity(0), y_velocity(0)
, state(FadeIn), data(0)
{
@@ -105,21 +105,21 @@ public:
//---------------------------------------------------------------------------
-QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParticleMotion,QFxParticleMotion)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParticleMotion,QmlGraphicsParticleMotion)
/*!
- \class QFxParticleMotion
+ \class QmlGraphicsParticleMotion
\ingroup group_effects
- \brief The QFxParticleMotion class is the base class for particle motion.
+ \brief The QmlGraphicsParticleMotion class is the base class for particle motion.
\internal
This class causes the particles to remain static.
*/
/*!
- Constructs a QFxParticleMotion with parent object \a parent.
+ Constructs a QmlGraphicsParticleMotion with parent object \a parent.
*/
-QFxParticleMotion::QFxParticleMotion(QObject *parent) :
+QmlGraphicsParticleMotion::QmlGraphicsParticleMotion(QObject *parent) :
QObject(parent)
{
}
@@ -128,7 +128,7 @@ QFxParticleMotion::QFxParticleMotion(QObject *parent) :
Move the \a particle to its new position. \a interval is the number of
milliseconds elapsed since it was last moved.
*/
-void QFxParticleMotion::advance(QFxParticle &particle, int interval)
+void QmlGraphicsParticleMotion::advance(QmlGraphicsParticle &particle, int interval)
{
Q_UNUSED(particle);
Q_UNUSED(interval);
@@ -138,7 +138,7 @@ void QFxParticleMotion::advance(QFxParticle &particle, int interval)
The \a particle has just been created. Some motion strategies require
additional state information. This can be allocated by this function.
*/
-void QFxParticleMotion::created(QFxParticle &particle)
+void QmlGraphicsParticleMotion::created(QmlGraphicsParticle &particle)
{
Q_UNUSED(particle);
}
@@ -147,7 +147,7 @@ void QFxParticleMotion::created(QFxParticle &particle)
The \a particle is about to be destroyed. Any additional memory
that has been allocated for the particle should be freed.
*/
-void QFxParticleMotion::destroy(QFxParticle &particle)
+void QmlGraphicsParticleMotion::destroy(QmlGraphicsParticle &particle)
{
Q_UNUSED(particle);
}
@@ -161,14 +161,14 @@ void QFxParticleMotion::destroy(QFxParticle &particle)
/*!
\internal
- \class QFxParticleMotionLinear
+ \class QmlGraphicsParticleMotionLinear
\ingroup group_effects
- \brief The QFxParticleMotionLinear class moves the particles linearly.
+ \brief The QmlGraphicsParticleMotionLinear class moves the particles linearly.
*/
-QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParticleMotionLinear,QFxParticleMotionLinear)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParticleMotionLinear,QmlGraphicsParticleMotionLinear)
-void QFxParticleMotionLinear::advance(QFxParticle &p, int interval)
+void QmlGraphicsParticleMotionLinear::advance(QmlGraphicsParticle &p, int interval)
{
p.x += interval * p.x_velocity;
p.y += interval * p.y_velocity;
@@ -183,12 +183,12 @@ void QFxParticleMotionLinear::advance(QFxParticle &p, int interval)
/*!
\internal
- \class QFxParticleMotionGravity
+ \class QmlGraphicsParticleMotionGravity
\ingroup group_effects
- \brief The QFxParticleMotionGravity class moves the particles towards a point.
+ \brief The QmlGraphicsParticleMotionGravity class moves the particles towards a point.
*/
-QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParticleMotionGravity,QFxParticleMotionGravity)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParticleMotionGravity,QmlGraphicsParticleMotionGravity)
/*!
\qmlproperty int ParticleMotionGravity::xattractor
@@ -202,21 +202,21 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParticleMotionGravity,QFxParticl
*/
/*!
- \property QFxParticleMotionGravity::xattractor
+ \property QmlGraphicsParticleMotionGravity::xattractor
\brief the x coordinate of the point attracting the particles.
*/
/*!
- \property QFxParticleMotionGravity::yattractor
+ \property QmlGraphicsParticleMotionGravity::yattractor
\brief the y coordinate of the point attracting the particles.
*/
/*!
- \property QFxParticleMotionGravity::acceleration
+ \property QmlGraphicsParticleMotionGravity::acceleration
\brief the acceleration to apply to the particles.
*/
-void QFxParticleMotionGravity::advance(QFxParticle &p, int interval)
+void QmlGraphicsParticleMotionGravity::advance(QmlGraphicsParticle &p, int interval)
{
qreal xdiff = p.x - _xAttr;
qreal ydiff = p.y - _yAttr;
@@ -270,32 +270,32 @@ Rectangle {
/*!
\internal
- \class QFxParticleMotionWander
+ \class QmlGraphicsParticleMotionWander
\ingroup group_effects
- \brief The QFxParticleMotionWander class moves particles in a somewhat random fashion.
+ \brief The QmlGraphicsParticleMotionWander class moves particles in a somewhat random fashion.
The particles will continue roughly in the original direction, however will randomly
drift to each side.
*/
/*!
- \qmlproperty int QFxParticleMotionWander::xvariance
- \qmlproperty int QFxParticleMotionWander::yvariance
+ \qmlproperty int QmlGraphicsParticleMotionWander::xvariance
+ \qmlproperty int QmlGraphicsParticleMotionWander::yvariance
These properties set the amount to wander in the x and y directions.
*/
/*!
- \qmlproperty int QFxParticleMotionWander::pace
+ \qmlproperty int QmlGraphicsParticleMotionWander::pace
This property holds how quickly the paricles will move from side to side.
*/
-QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParticleMotionWander,QFxParticleMotionWander)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParticleMotionWander,QmlGraphicsParticleMotionWander)
-void QFxParticleMotionWander::advance(QFxParticle &p, int interval)
+void QmlGraphicsParticleMotionWander::advance(QmlGraphicsParticle &p, int interval)
{
if (!particles)
- particles = qobject_cast<QFxParticles*>(parent());
+ particles = qobject_cast<QmlGraphicsParticles*>(parent());
if (particles) {
Data *d = (Data*)p.data;
if (_xvariance != 0.) {
@@ -320,7 +320,7 @@ void QFxParticleMotionWander::advance(QFxParticle &p, int interval)
}
}
-void QFxParticleMotionWander::created(QFxParticle &p)
+void QmlGraphicsParticleMotionWander::created(QmlGraphicsParticle &p)
{
if (!p.data) {
Data *d = new Data;
@@ -334,18 +334,18 @@ void QFxParticleMotionWander::created(QFxParticle &p)
}
}
-void QFxParticleMotionWander::destroy(QFxParticle &p)
+void QmlGraphicsParticleMotionWander::destroy(QmlGraphicsParticle &p)
{
if (p.data)
delete (Data*)p.data;
}
//---------------------------------------------------------------------------
-class QFxParticlesPainter : public QFxItem
+class QmlGraphicsParticlesPainter : public QmlGraphicsItem
{
public:
- QFxParticlesPainter(QFxParticlesPrivate *p, QFxItem* parent)
- : QFxItem(parent), d(p)
+ QmlGraphicsParticlesPainter(QmlGraphicsParticlesPrivate *p, QmlGraphicsItem* parent)
+ : QmlGraphicsItem(parent), d(p)
{
setFlag(QGraphicsItem::ItemHasNoContents, false);
maxX = minX = maxY = minY = 0;
@@ -359,16 +359,15 @@ public:
qreal minX;
qreal maxY;
qreal minY;
- QVarLengthArray<QDrawPixmaps::Data, 50> pixmapData;
- QFxParticlesPrivate* d;
+ QmlGraphicsParticlesPrivate* d;
};
//---------------------------------------------------------------------------
-class QFxParticlesPrivate : public QFxItemPrivate
+class QmlGraphicsParticlesPrivate : public QmlGraphicsItemPrivate
{
- Q_DECLARE_PUBLIC(QFxParticles)
+ Q_DECLARE_PUBLIC(QmlGraphicsParticles)
public:
- QFxParticlesPrivate()
+ QmlGraphicsParticlesPrivate()
: count(1), lifeSpan(1000), lifeSpanDev(1000), fadeInDur(200), fadeOutDur(300)
, angle(0), angleDev(0), velocity(0), velocityDev(0)
, addParticleTime(0), addParticleCount(0), lastAdvTime(0), stream(false), streamDelay(0)
@@ -376,20 +375,19 @@ public:
{
}
- ~QFxParticlesPrivate()
+ ~QmlGraphicsParticlesPrivate()
{
}
void init()
{
- Q_Q(QFxParticles);
- paintItem = new QFxParticlesPainter(this, q);
- paintItem->pixmapData.resize(count);
+ Q_Q(QmlGraphicsParticles);
+ paintItem = new QmlGraphicsParticlesPainter(this, q);
}
void tick(int time);
void createParticle(int time);
- void updateOpacity(QFxParticle &p, int age);
+ void updateOpacity(QmlGraphicsParticle &p, int age);
QUrl url;
QPixmap image;
@@ -408,30 +406,30 @@ public:
bool stream;
int streamDelay;
bool emitting;
- QFxParticleMotion *motion;
- QFxParticlesPainter *paintItem;
+ QmlGraphicsParticleMotion *motion;
+ QmlGraphicsParticlesPainter *paintItem;
bool pendingPixmapCache;
- QList<QFxParticle> particles;
- QTickAnimationProxy<QFxParticlesPrivate, &QFxParticlesPrivate::tick> clock;
+ QList<QmlGraphicsParticle> particles;
+ QTickAnimationProxy<QmlGraphicsParticlesPrivate, &QmlGraphicsParticlesPrivate::tick> clock;
};
-void QFxParticlesPrivate::tick(int time)
+void QmlGraphicsParticlesPrivate::tick(int time)
{
- Q_Q(QFxParticles);
+ Q_Q(QmlGraphicsParticles);
if (!motion)
- motion = new QFxParticleMotionLinear(q);
+ motion = new QmlGraphicsParticleMotionLinear(q);
int oldCount = particles.count();
int removed = 0;
int interval = time - lastAdvTime;
for (int i = 0; i < particles.count(); ) {
- QFxParticle &particle = particles[i];
+ QmlGraphicsParticle &particle = particles[i];
int age = time - particle.birthTime;
if (age >= particle.lifeSpan) {
- QFxParticle part = particles.takeAt(i);
+ QmlGraphicsParticle part = particles.takeAt(i);
motion->destroy(part);
++removed;
} else {
@@ -480,13 +478,13 @@ void QFxParticlesPrivate::tick(int time)
}
}
-void QFxParticlesPrivate::createParticle(int time)
+void QmlGraphicsParticlesPrivate::createParticle(int time)
{
#ifdef Q_ENABLE_PERFORMANCE_LOG
- QFxPerfTimer<QFxPerf::CreateParticle> x;
+ QmlPerfTimer<QmlPerf::CreateParticle> x;
#endif
- Q_Q(QFxParticles);
- QFxParticle p(time);
+ Q_Q(QmlGraphicsParticles);
+ QmlGraphicsParticle p(time);
p.x = q->x() + q->width() * qreal(rand()) / RAND_MAX - image.width()/2.0;
p.y = q->y() + q->height() * qreal(rand()) / RAND_MAX - image.height()/2.0;
p.lifeSpan = lifeSpan;
@@ -494,7 +492,7 @@ void QFxParticlesPrivate::createParticle(int time)
p.lifeSpan += int(lifeSpanDev/2 - lifeSpanDev * qreal(rand()) / RAND_MAX);
p.fadeOutAge = p.lifeSpan - fadeOutDur;
if (fadeInDur == 0.) {
- p.state= QFxParticle::Solid;
+ p.state= QmlGraphicsParticle::Solid;
p.opacity = 1.0;
}
qreal a = angle;
@@ -511,32 +509,32 @@ void QFxParticlesPrivate::createParticle(int time)
motion->created(particles.last());
}
-void QFxParticlesPrivate::updateOpacity(QFxParticle &p, int age)
+void QmlGraphicsParticlesPrivate::updateOpacity(QmlGraphicsParticle &p, int age)
{
switch (p.state) {
- case QFxParticle::FadeIn:
+ case QmlGraphicsParticle::FadeIn:
if (age <= fadeInDur) {
p.opacity = qreal(age) / fadeInDur;
break;
} else {
p.opacity = 1.0;
- p.state = QFxParticle::Solid;
+ p.state = QmlGraphicsParticle::Solid;
// Fall through
}
- case QFxParticle::Solid:
+ case QmlGraphicsParticle::Solid:
if (age <= p.fadeOutAge) {
break;
} else {
- p.state = QFxParticle::FadeOut;
+ p.state = QmlGraphicsParticle::FadeOut;
// Fall through
}
- case QFxParticle::FadeOut:
+ case QmlGraphicsParticle::FadeOut:
p.opacity = qreal(p.lifeSpan - age) / fadeOutDur;
break;
}
}
-QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Particles,QFxParticles)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Particles,QmlGraphicsParticles)
/*!
\qmlclass Particles
@@ -598,30 +596,30 @@ Rectangle {
/*!
\internal
- \class QFxParticles
+ \class QmlGraphicsParticles
\ingroup group_effects
- \brief The QFxParticles class generates and moves particles.
+ \brief The QmlGraphicsParticles class generates and moves particles.
*/
-QFxParticles::QFxParticles(QFxItem *parent)
- : QFxItem(*(new QFxParticlesPrivate), parent)
+QmlGraphicsParticles::QmlGraphicsParticles(QmlGraphicsItem *parent)
+ : QmlGraphicsItem(*(new QmlGraphicsParticlesPrivate), parent)
{
- Q_D(QFxParticles);
+ Q_D(QmlGraphicsParticles);
d->init();
}
-QFxParticles::QFxParticles(QFxParticlesPrivate &dd, QFxItem *parent)
- : QFxItem(dd, parent)
+QmlGraphicsParticles::QmlGraphicsParticles(QmlGraphicsParticlesPrivate &dd, QmlGraphicsItem *parent)
+ : QmlGraphicsItem(dd, parent)
{
- Q_D(QFxParticles);
+ Q_D(QmlGraphicsParticles);
d->init();
}
-QFxParticles::~QFxParticles()
+QmlGraphicsParticles::~QmlGraphicsParticles()
{
- Q_D(QFxParticles);
+ Q_D(QmlGraphicsParticles);
if (d->pendingPixmapCache)
- QFxPixmapCache::cancelGet(d->url, this);
+ QmlGraphicsPixmapCache::cancelGet(d->url, this);
}
/*!
@@ -630,33 +628,33 @@ QFxParticles::~QFxParticles()
*/
/*!
- \property QFxParticles::source
+ \property QmlGraphicsParticles::source
\brief the URL of the particle image.
*/
-QUrl QFxParticles::source() const
+QUrl QmlGraphicsParticles::source() const
{
- Q_D(const QFxParticles);
+ Q_D(const QmlGraphicsParticles);
return d->url;
}
-void QFxParticles::imageLoaded()
+void QmlGraphicsParticles::imageLoaded()
{
- Q_D(QFxParticles);
+ Q_D(QmlGraphicsParticles);
d->pendingPixmapCache = false;
- QFxPixmapCache::find(d->url, &d->image);
+ QmlGraphicsPixmapCache::find(d->url, &d->image);
d->paintItem->updateSize();
d->paintItem->update();
}
-void QFxParticles::setSource(const QUrl &name)
+void QmlGraphicsParticles::setSource(const QUrl &name)
{
- Q_D(QFxParticles);
+ Q_D(QmlGraphicsParticles);
if ((d->url.isEmpty() == name.isEmpty()) && name == d->url)
return;
if (d->pendingPixmapCache) {
- QFxPixmapCache::cancelGet(d->url, this);
+ QmlGraphicsPixmapCache::cancelGet(d->url, this);
d->pendingPixmapCache = false;
}
if (name.isEmpty()) {
@@ -667,7 +665,7 @@ void QFxParticles::setSource(const QUrl &name)
} else {
d->url = name;
Q_ASSERT(!name.isRelative());
- QNetworkReply *reply = QFxPixmapCache::get(qmlEngine(this), d->url, &d->image);
+ QNetworkReply *reply = QmlGraphicsPixmapCache::get(qmlEngine(this), d->url, &d->image);
if (reply) {
connect(reply, SIGNAL(finished()), this, SLOT(imageLoaded()));
d->pendingPixmapCache = true;
@@ -685,25 +683,23 @@ void QFxParticles::setSource(const QUrl &name)
*/
/*!
- \property QFxParticles::count
+ \property QmlGraphicsParticles::count
\brief the target number of particles
*/
-int QFxParticles::count() const
+int QmlGraphicsParticles::count() const
{
- Q_D(const QFxParticles);
+ Q_D(const QmlGraphicsParticles);
return d->count;
}
-void QFxParticles::setCount(int cnt)
+void QmlGraphicsParticles::setCount(int cnt)
{
- Q_D(QFxParticles);
+ Q_D(QmlGraphicsParticles);
if (cnt == d->count)
return;
int oldCount = d->count;
d->count = cnt;
- if (cnt > oldCount)
- d->paintItem->pixmapData.resize(d->count);
d->addParticleTime = 0;
d->addParticleCount = d->particles.count();
if (!oldCount && d->clock.state() != QAbstractAnimation::Running && d->count) {
@@ -735,27 +731,27 @@ Particles {
*/
/*!
- \property QFxParticles::lifeSpan
+ \property QmlGraphicsParticles::lifeSpan
\brief the life span of each particle.
Default value is 1000ms.
- \sa QFxParticles::lifeSpanDeviation
+ \sa QmlGraphicsParticles::lifeSpanDeviation
*/
-int QFxParticles::lifeSpan() const
+int QmlGraphicsParticles::lifeSpan() const
{
- Q_D(const QFxParticles);
+ Q_D(const QmlGraphicsParticles);
return d->lifeSpan;
}
-void QFxParticles::setLifeSpan(int ls)
+void QmlGraphicsParticles::setLifeSpan(int ls)
{
- Q_D(QFxParticles);
+ Q_D(QmlGraphicsParticles);
d->lifeSpan = ls;
}
/*!
- \property QFxParticles::lifeSpanDeviation
+ \property QmlGraphicsParticles::lifeSpanDeviation
\brief the maximum possible deviation from the set lifeSpan.
Randomly varies the lifeSpan up to the specified variation. For
@@ -770,17 +766,17 @@ Particles {
}
\endqml
- \sa QFxParticles::lifeSpan
+ \sa QmlGraphicsParticles::lifeSpan
*/
-int QFxParticles::lifeSpanDeviation() const
+int QmlGraphicsParticles::lifeSpanDeviation() const
{
- Q_D(const QFxParticles);
+ Q_D(const QmlGraphicsParticles);
return d->lifeSpanDev;
}
-void QFxParticles::setLifeSpanDeviation(int dev)
+void QmlGraphicsParticles::setLifeSpanDeviation(int dev)
{
- Q_D(QFxParticles);
+ Q_D(QmlGraphicsParticles);
d->lifeSpanDev = dev;
}
@@ -793,39 +789,39 @@ void QFxParticles::setLifeSpanDeviation(int dev)
*/
/*!
- \property QFxParticles::fadeInDuration
+ \property QmlGraphicsParticles::fadeInDuration
\brief the time taken to fade in the particles.
Default value is 200ms.
*/
-int QFxParticles::fadeInDuration() const
+int QmlGraphicsParticles::fadeInDuration() const
{
- Q_D(const QFxParticles);
+ Q_D(const QmlGraphicsParticles);
return d->fadeInDur;
}
-void QFxParticles::setFadeInDuration(int dur)
+void QmlGraphicsParticles::setFadeInDuration(int dur)
{
- Q_D(QFxParticles);
+ Q_D(QmlGraphicsParticles);
if (dur >= 0.0)
d->fadeInDur = dur;
}
/*!
- \property QFxParticles::fadeOutDuration
+ \property QmlGraphicsParticles::fadeOutDuration
\brief the time taken to fade out the particles.
Default value is 300ms.
*/
-int QFxParticles::fadeOutDuration() const
+int QmlGraphicsParticles::fadeOutDuration() const
{
- Q_D(const QFxParticles);
+ Q_D(const QmlGraphicsParticles);
return d->fadeOutDur;
}
-void QFxParticles::setFadeOutDuration(int dur)
+void QmlGraphicsParticles::setFadeOutDuration(int dur)
{
- Q_D(QFxParticles);
+ Q_D(QmlGraphicsParticles);
if (dur >= 0.0)
d->fadeOutDur = dur;
}
@@ -850,25 +846,25 @@ Particles {
*/
/*!
- \property QFxParticles::angle
+ \property QmlGraphicsParticles::angle
\brief the initial angle of direction.
- \sa QFxParticles::angleDeviation
+ \sa QmlGraphicsParticles::angleDeviation
*/
-qreal QFxParticles::angle() const
+qreal QmlGraphicsParticles::angle() const
{
- Q_D(const QFxParticles);
+ Q_D(const QmlGraphicsParticles);
return d->angle * 180.0 / M_PI;
}
-void QFxParticles::setAngle(qreal angle)
+void QmlGraphicsParticles::setAngle(qreal angle)
{
- Q_D(QFxParticles);
+ Q_D(QmlGraphicsParticles);
d->angle = angle * M_PI / 180.0;
}
/*!
- \property QFxParticles::angleDeviation
+ \property QmlGraphicsParticles::angleDeviation
\brief the maximum possible deviation from the set angle.
Randomly varies the direction up to the specified variation. For
@@ -883,17 +879,17 @@ Particles {
}
\endqml
- \sa QFxParticles::angle
+ \sa QmlGraphicsParticles::angle
*/
-qreal QFxParticles::angleDeviation() const
+qreal QmlGraphicsParticles::angleDeviation() const
{
- Q_D(const QFxParticles);
+ Q_D(const QmlGraphicsParticles);
return d->angleDev * 180.0 / M_PI;
}
-void QFxParticles::setAngleDeviation(qreal dev)
+void QmlGraphicsParticles::setAngleDeviation(qreal dev)
{
- Q_D(QFxParticles);
+ Q_D(QmlGraphicsParticles);
d->angleDev = dev * M_PI / 180.0;;
}
@@ -917,25 +913,25 @@ Particles {
*/
/*!
- \property QFxParticles::velocity
+ \property QmlGraphicsParticles::velocity
\brief the initial velocity of the particles.
- \sa QFxParticles::velocityDeviation
+ \sa QmlGraphicsParticles::velocityDeviation
*/
-qreal QFxParticles::velocity() const
+qreal QmlGraphicsParticles::velocity() const
{
- Q_D(const QFxParticles);
+ Q_D(const QmlGraphicsParticles);
return d->velocity * 1000.0;
}
-void QFxParticles::setVelocity(qreal velocity)
+void QmlGraphicsParticles::setVelocity(qreal velocity)
{
- Q_D(QFxParticles);
+ Q_D(QmlGraphicsParticles);
d->velocity = velocity / 1000.0;
}
/*!
- \property QFxParticles::velocityDeviation
+ \property QmlGraphicsParticles::velocityDeviation
\brief the maximum possible deviation from the set velocity.
Randomly varies the velocity up to the specified variation. For
@@ -950,17 +946,17 @@ Particles {
}
\endqml
- \sa QFxParticles::velocity
+ \sa QmlGraphicsParticles::velocity
*/
-qreal QFxParticles::velocityDeviation() const
+qreal QmlGraphicsParticles::velocityDeviation() const
{
- Q_D(const QFxParticles);
+ Q_D(const QmlGraphicsParticles);
return d->velocityDev * 1000.0;
}
-void QFxParticles::setVelocityDeviation(qreal velocity)
+void QmlGraphicsParticles::setVelocityDeviation(qreal velocity)
{
- Q_D(QFxParticles);
+ Q_D(QmlGraphicsParticles);
d->velocityDev = velocity / 1000.0;
}
@@ -974,7 +970,7 @@ void QFxParticles::setVelocityDeviation(qreal velocity)
particles to unclump over time.
*/
/*!
- \property QFxParticles::streamIn
+ \property QmlGraphicsParticles::streamIn
\brief determines whether the particles stream in at a constant rate
When stream is set to true the particles will stream in at a constant rate.
@@ -983,15 +979,15 @@ void QFxParticles::setVelocityDeviation(qreal velocity)
*/
//The name may need a rethink
-bool QFxParticles::streamIn() const
+bool QmlGraphicsParticles::streamIn() const
{
- Q_D(const QFxParticles);
+ Q_D(const QmlGraphicsParticles);
return d->stream;
}
-void QFxParticles::setStreamIn(bool b)
+void QmlGraphicsParticles::setStreamIn(bool b)
{
- Q_D(QFxParticles);
+ Q_D(QmlGraphicsParticles);
d->stream = b;
}
@@ -1007,7 +1003,7 @@ void QFxParticles::setStreamIn(bool b)
will be produced until it is set to true.
*/
/*!
- \property QFxParticles::emitting
+ \property QmlGraphicsParticles::emitting
If emitting is set to false no new particles will be created. This means that
when a particle reaches the end of its lifespan it is not replaced. This
property can be used to turn particles on and off with a more natural look.
@@ -1015,15 +1011,15 @@ void QFxParticles::setStreamIn(bool b)
The default setting is true. Note that if it initialized to false no particles
will be produced until it is set to true.
*/
-bool QFxParticles::emitting() const
+bool QmlGraphicsParticles::emitting() const
{
- Q_D(const QFxParticles);
+ Q_D(const QmlGraphicsParticles);
return d->emitting;
}
-void QFxParticles::setEmitting(bool r)
+void QmlGraphicsParticles::setEmitting(bool r)
{
- Q_D(QFxParticles);
+ Q_D(QmlGraphicsParticles);
d->emitting = r;
if (d->count && r)
d->clock.start();
@@ -1040,28 +1036,28 @@ void QFxParticles::setEmitting(bool r)
*/
/*!
- \property QFxParticles::motion
+ \property QmlGraphicsParticles::motion
\brief sets the type of motion to apply to the particles.
When a particle is created it will have an initial direction and velocity.
The motion of the particle during its lifeSpan is then influenced by the
motion property.
- Default motion is QFxParticleMotionLinear.
+ Default motion is QmlGraphicsParticleMotionLinear.
*/
-QFxParticleMotion *QFxParticles::motion() const
+QmlGraphicsParticleMotion *QmlGraphicsParticles::motion() const
{
- Q_D(const QFxParticles);
+ Q_D(const QmlGraphicsParticles);
return d->motion;
}
-void QFxParticles::setMotion(QFxParticleMotion *motion)
+void QmlGraphicsParticles::setMotion(QmlGraphicsParticleMotion *motion)
{
- Q_D(QFxParticles);
+ Q_D(QmlGraphicsParticles);
d->motion = motion;
}
-void QFxParticlesPainter::updateSize()
+void QmlGraphicsParticlesPainter::updateSize()
{
if (!isComponentComplete())
return;
@@ -1069,7 +1065,7 @@ void QFxParticlesPainter::updateSize()
const int parentX = parentItem()->x();
const int parentY = parentItem()->y();
for (int i = 0; i < d->particles.count(); ++i) {
- const QFxParticle &particle = d->particles.at(i);
+ const QmlGraphicsParticle &particle = d->particles.at(i);
if(particle.x > maxX)
maxX = particle.x;
if(particle.x < minX)
@@ -1090,13 +1086,13 @@ void QFxParticlesPainter::updateSize()
setY(myY);
}
-void QFxParticles::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
+void QmlGraphicsParticles::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
{
Q_UNUSED(p);
//painting is done by the ParticlesPainter, so it can have the right size
}
-void QFxParticlesPainter::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
+void QmlGraphicsParticlesPainter::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
{
if (d->image.isNull() || d->particles.isEmpty())
return;
@@ -1104,9 +1100,13 @@ void QFxParticlesPainter::paint(QPainter *p, const QStyleOptionGraphicsItem *, Q
const int myX = x() + parentItem()->x();
const int myY = y() + parentItem()->y();
+ static QVarLengthArray<QDrawPixmaps::Data, 256> pixmapData;
+ if (pixmapData.count() < d->particles.count())
+ pixmapData.resize(d->particles.count());
+
const QRectF sourceRect = d->image.rect();
for (int i = 0; i < d->particles.count(); ++i) {
- const QFxParticle &particle = d->particles.at(i);
+ const QmlGraphicsParticle &particle = d->particles.at(i);
pixmapData[i].point = QPointF(particle.x - myX, particle.y - myY);
pixmapData[i].opacity = particle.opacity;
@@ -1119,10 +1119,10 @@ void QFxParticlesPainter::paint(QPainter *p, const QStyleOptionGraphicsItem *, Q
qDrawPixmaps(p, pixmapData.data(), d->particles.count(), d->image);
}
-void QFxParticles::componentComplete()
+void QmlGraphicsParticles::componentComplete()
{
- Q_D(QFxParticles);
- QFxItem::componentComplete();
+ Q_D(QmlGraphicsParticles);
+ QmlGraphicsItem::componentComplete();
if (d->count) {
d->paintItem->updateSize();
d->clock.start();
diff --git a/src/declarative/extra/qfxparticles.h b/src/declarative/extra/qmlgraphicsparticles_p.h
index 959c518..9eca762 100644
--- a/src/declarative/extra/qfxparticles.h
+++ b/src/declarative/extra/qmlgraphicsparticles_p.h
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,29 +21,28 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef QFXPARTICLES_H
-#define QFXPARTICLES_H
+#ifndef QMLGRAPHICSPARTICLES_H
+#define QMLGRAPHICSPARTICLES_H
-#include <QtDeclarative/qfxitem.h>
+#include <QtDeclarative/qmlgraphicsitem.h>
QT_BEGIN_HEADER
@@ -50,30 +50,30 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
-class QFxParticle;
-class QFxParticles;
-class Q_DECLARATIVE_EXPORT QFxParticleMotion : public QObject
+class QmlGraphicsParticle;
+class QmlGraphicsParticles;
+class Q_DECLARATIVE_EXPORT QmlGraphicsParticleMotion : public QObject
{
Q_OBJECT
public:
- QFxParticleMotion(QObject *parent=0);
+ QmlGraphicsParticleMotion(QObject *parent=0);
- virtual void advance(QFxParticle &, int interval);
- virtual void created(QFxParticle &);
- virtual void destroy(QFxParticle &);
+ virtual void advance(QmlGraphicsParticle &, int interval);
+ virtual void created(QmlGraphicsParticle &);
+ virtual void destroy(QmlGraphicsParticle &);
};
-class Q_DECLARATIVE_EXPORT QFxParticleMotionLinear : public QFxParticleMotion
+class Q_DECLARATIVE_EXPORT QmlGraphicsParticleMotionLinear : public QmlGraphicsParticleMotion
{
Q_OBJECT
public:
- QFxParticleMotionLinear(QObject *parent=0)
- : QFxParticleMotion(parent) {}
+ QmlGraphicsParticleMotionLinear(QObject *parent=0)
+ : QmlGraphicsParticleMotion(parent) {}
- virtual void advance(QFxParticle &, int interval);
+ virtual void advance(QmlGraphicsParticle &, int interval);
};
-class Q_DECLARATIVE_EXPORT QFxParticleMotionGravity : public QFxParticleMotion
+class Q_DECLARATIVE_EXPORT QmlGraphicsParticleMotionGravity : public QmlGraphicsParticleMotion
{
Q_OBJECT
@@ -81,8 +81,8 @@ class Q_DECLARATIVE_EXPORT QFxParticleMotionGravity : public QFxParticleMotion
Q_PROPERTY(int yattractor READ yAttractor WRITE setYAttractor)
Q_PROPERTY(int acceleration READ acceleration WRITE setAcceleration)
public:
- QFxParticleMotionGravity(QObject *parent=0)
- : QFxParticleMotion(parent), _xAttr(0), _yAttr(0), _accel(0.00005) {}
+ QmlGraphicsParticleMotionGravity(QObject *parent=0)
+ : QmlGraphicsParticleMotion(parent), _xAttr(0), _yAttr(0), _accel(0.00005) {}
int xAttractor() const { return _xAttr; }
void setXAttractor(int x) { _xAttr = x; }
@@ -93,7 +93,7 @@ public:
int acceleration() const { return int(_accel * 1000000); }
void setAcceleration(int accel) { _accel = qreal(accel)/1000000.0; }
- virtual void advance(QFxParticle &, int interval);
+ virtual void advance(QmlGraphicsParticle &, int interval);
private:
int _xAttr;
@@ -101,16 +101,16 @@ private:
qreal _accel;
};
-class Q_DECLARATIVE_EXPORT QFxParticleMotionWander : public QFxParticleMotion
+class Q_DECLARATIVE_EXPORT QmlGraphicsParticleMotionWander : public QmlGraphicsParticleMotion
{
Q_OBJECT
public:
- QFxParticleMotionWander()
- : QFxParticleMotion(), particles(0), _xvariance(0), _yvariance(0) {}
+ QmlGraphicsParticleMotionWander()
+ : QmlGraphicsParticleMotion(), particles(0), _xvariance(0), _yvariance(0) {}
- virtual void advance(QFxParticle &, int interval);
- virtual void created(QFxParticle &);
- virtual void destroy(QFxParticle &);
+ virtual void advance(QmlGraphicsParticle &, int interval);
+ virtual void created(QmlGraphicsParticle &);
+ virtual void destroy(QmlGraphicsParticle &);
struct Data {
qreal x_targetV;
@@ -134,14 +134,14 @@ public:
void setPace(int pace) { _pace = pace / 1000.0; }
private:
- QFxParticles *particles;
+ QmlGraphicsParticles *particles;
qreal _xvariance;
qreal _yvariance;
qreal _pace;
};
-class QFxParticlesPrivate;
-class Q_DECLARATIVE_EXPORT QFxParticles : public QFxItem
+class QmlGraphicsParticlesPrivate;
+class Q_DECLARATIVE_EXPORT QmlGraphicsParticles : public QmlGraphicsItem
{
Q_OBJECT
@@ -157,12 +157,12 @@ class Q_DECLARATIVE_EXPORT QFxParticles : public QFxItem
Q_PROPERTY(qreal velocityDeviation READ velocityDeviation WRITE setVelocityDeviation)
Q_PROPERTY(bool streamIn READ streamIn WRITE setStreamIn)
Q_PROPERTY(bool emitting READ emitting WRITE setEmitting)
- Q_PROPERTY(QFxParticleMotion *motion READ motion WRITE setMotion)
+ Q_PROPERTY(QmlGraphicsParticleMotion *motion READ motion WRITE setMotion)
Q_CLASSINFO("DefaultProperty", "motion")
public:
- QFxParticles(QFxItem *parent=0);
- ~QFxParticles();
+ QmlGraphicsParticles(QmlGraphicsItem *parent=0);
+ ~QmlGraphicsParticles();
QUrl source() const;
void setSource(const QUrl &);
@@ -200,30 +200,30 @@ public:
bool emitting() const;
void setEmitting(bool);
- QFxParticleMotion *motion() const;
- void setMotion(QFxParticleMotion *);
+ QmlGraphicsParticleMotion *motion() const;
+ void setMotion(QmlGraphicsParticleMotion *);
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
protected:
virtual void componentComplete();
- QFxParticles(QFxParticlesPrivate &dd, QFxItem *parent);
+ QmlGraphicsParticles(QmlGraphicsParticlesPrivate &dd, QmlGraphicsItem *parent);
private Q_SLOTS:
void imageLoaded();
private:
- Q_DISABLE_COPY(QFxParticles)
- Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QFxParticles)
+ Q_DISABLE_COPY(QmlGraphicsParticles)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsParticles)
};
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QFxParticleMotion)
-QML_DECLARE_TYPE(QFxParticleMotionLinear)
-QML_DECLARE_TYPE(QFxParticleMotionGravity)
-QML_DECLARE_TYPE(QFxParticleMotionWander)
-QML_DECLARE_TYPE(QFxParticles)
+QML_DECLARE_TYPE(QmlGraphicsParticleMotion)
+QML_DECLARE_TYPE(QmlGraphicsParticleMotionLinear)
+QML_DECLARE_TYPE(QmlGraphicsParticleMotionGravity)
+QML_DECLARE_TYPE(QmlGraphicsParticleMotionWander)
+QML_DECLARE_TYPE(QmlGraphicsParticles)
QT_END_HEADER
diff --git a/src/declarative/extra/qmlnumberformatter.cpp b/src/declarative/extra/qmlnumberformatter.cpp
index 5b76e45..9e599c7 100644
--- a/src/declarative/extra/qmlnumberformatter.cpp
+++ b/src/declarative/extra/qmlnumberformatter.cpp
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,26 +21,25 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "qmlnumberformatter.h"
+#include "qmlnumberformatter_p.h"
#include "private/qobject_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/extra/qmlnumberformatter.h b/src/declarative/extra/qmlnumberformatter_p.h
index d9abee7..0036cb9 100644
--- a/src/declarative/extra/qmlnumberformatter.h
+++ b/src/declarative/extra/qmlnumberformatter_p.h
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,21 +21,20 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -43,7 +43,7 @@
#define QMLNUMBERFORMATTER_H
#include <QtDeclarative/qml.h>
-#include <QtDeclarative/qnumberformat.h>
+#include <private/qnumberformat_p.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/extra/qmlsqlconnection.cpp b/src/declarative/extra/qmlsqlconnection.cpp
deleted file mode 100644
index bed92ef..0000000
--- a/src/declarative/extra/qmlsqlconnection.cpp
+++ /dev/null
@@ -1,429 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qmlsqlconnection.h"
-#include "private/qobject_p.h"
-
-#include <QSqlError>
-#include <QSqlDriver>
-#include <QDebug>
-
-#include <qml.h>
-#include <qmlcontext.h>
-
-QT_BEGIN_NAMESPACE
-
-QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,SqlConnection,QmlSqlConnection)
-
-class QmlSqlConnectionPrivate: public QObjectPrivate
-{
- Q_DECLARE_PUBLIC(QmlSqlConnection)
-public:
- QmlSqlConnectionPrivate() : port(0) {}
-
- int port;
- QString name, databaseName, connectionOptions;
- QString hostName, userName, password, driver;
-};
-
-/*!
- \qmlclass SqlConnection QmlSqlConnection
- \brief The SqlConnection element describes a connection to an SQL database.
-
- The SqlConnection element works in a similar way to
- QSqlDatabase::addDatabase(). It allows setting the database properties
- such that the connection does not need to be set up in C++ code.
- It differs from QSqlDatabase::addDatabase() in that it will automatically
- open the database.
-
- The database can then either be used from an SqlQuery element using its id
- as a bind, or using its name. If the database is set up externally to
- Qml the query should connect using its name.
-
- \qml
- SqlConnection {
- id: myConnection
- name: "qmlConnection"
- driver: "QSQLITE"
- databaseName: "mydb.sqlite"
- }
- SqlQuery { id: listmodel; connection: myConnection; query: "SELECT * FROM mytable" }
- SqlQuery { id: othermodel; connection: "qmlConnection"; query: "SELECT * FROM myothertable" }
- \endqml
-*/
-
-/*!
- \qmlproperty QString SqlConnection::name
-
- Defines the connection's name. The name allows the connection to be
- retrieved using the connection property of SqlQuery or when
- QSqlDatabase::database()
-*/
-
-/*!
- \qmlproperty list<string> SqlConnection::tables
-
- Defines the set of tables that exist in the database for the connection.
-*/
-
-/*!
- \qmlproperty string SqlConnection::databaseName
-
- Defines the connection's database name. This is used when opening the
- connection to the database.
-*/
-
-/*!
- \qmlproperty string SqlConnection::driver
-
- Defines the driver type of the connection. This is used when opening the
- connection to the database.
-*/
-
-/*!
- \qmlproperty string SqlConnection::connectOptions
-
- Defines the options used when connecting to the database. These are used
- when opening the connection to the database.
-*/
-
-/*!
- \qmlproperty string SqlConnection::hostName
-
- Defines the connection's host name. This is used when opening the
- connection to the database.
-*/
-
-/*!
- \qmlproperty int SqlConnection::port
-
- Defines the connection's port number. This is used when opening the
- connection to the database.
-*/
-
-/*!
- \qmlproperty string SqlConnection::userName
-
- Defines the connection's user name. This is used when opening the
- connection to the database.
-*/
-
-/*!
- \qmlproperty string SqlConnection::password
-
- Defines the connection's password. This is used when opening the
- connection to the database.
-*/
-
-/*!
- \qmlproperty string SqlConnection::lastError
-
- Defines the last error, if one occurred, when working with the database.
- If the error occurred in conjunction with an SQL query the error will be
- defined by SqlQuery::lastError.
-*/
-
-/*!
- \internal
- \class QmlSqlConnection
- \brief The QmlSqlConnection class manages a connection to an SQL database.
-*/
-
-/*!
- Constructs a QmlSqlConnection with the given \a parent.
-*/
-QmlSqlConnection::QmlSqlConnection(QObject *parent)
-: QObject(*(new QmlSqlConnectionPrivate), parent)
-{
-}
-
-/*!
- Destroys the QmlSqlConnection.
-*/
-QmlSqlConnection::~QmlSqlConnection()
-{
- QSqlDatabase db = database();
- if (db.isOpen())
- db.close();
-}
-
-/*!
- Returns the connection's name.
- This is equivalent to QSqlDatabase::connectionName().
- \sa setName()
-*/
-QString QmlSqlConnection::name() const
-{
- Q_D(const QmlSqlConnection);
- return d->name;
-}
-
-/*!
- Returns the connection's database name.
- This is equivalent to QSqlDatabase::databaseName().
- \sa setDatabaseName()
-*/
-QString QmlSqlConnection::databaseName() const
-{
- Q_D(const QmlSqlConnection);
- return d->databaseName;
-}
-
-/*!
- Returns the connect options string used for this connection.
-
- \sa setConnectOptions()
-*/
-QString QmlSqlConnection::connectOptions() const
-{
- Q_D(const QmlSqlConnection);
- return d->connectionOptions;
-}
-
-/*!
- Returns the connection's host name.
- \sa setHostName()
-*/
-QString QmlSqlConnection::hostName() const
-{
- Q_D(const QmlSqlConnection);
- return d->hostName;
-}
-
-/*!
- Returns the connection's port number. The value is undefined if the port
- number has not been set.
-
- \sa setPort()
-*/
-int QmlSqlConnection::port() const
-{
- Q_D(const QmlSqlConnection);
- return d->port;
-}
-
-/*!
- Returns the connection's user name.
-
- \sa setUserName()
-*/
-QString QmlSqlConnection::userName() const
-{
- Q_D(const QmlSqlConnection);
- return d->userName;
-}
-
-/*!
- Returns the connection's password.
-
- \sa setPassword)()
-*/
-QString QmlSqlConnection::password() const
-{
- Q_D(const QmlSqlConnection);
- return d->password;
-}
-
-/*!
- Returns the connection's driver name.
-
- \sa setDriver()
-*/
-QString QmlSqlConnection::driver() const
-{
- Q_D(const QmlSqlConnection);
- return d->driver;
-}
-
-/*!
- Returns a list of the database's tables.
-*/
-QStringList QmlSqlConnection::tables() const
-{
- return database().tables();
-}
-
-/*!
- Sets the connection's name to the given \a name.
-
- \sa name()
-*/
-void QmlSqlConnection::setName(const QString &name)
-{
- Q_D(QmlSqlConnection);
- d->name = name;
-}
-
-/*!
- Set's the connection's database name to the given \a name.
-
- \sa databaseName()
-*/
-void QmlSqlConnection::setDatabaseName(const QString &name)
-{
- Q_D(QmlSqlConnection);
- d->databaseName = name;
-}
-
-/*!
- Sets the connection's options to the given \a options.
-
- \sa connectOptions(), QSqlDatabase::setConnectOptions()
-*/
-void QmlSqlConnection::setConnectOptions(const QString &options)
-{
- Q_D(QmlSqlConnection);
- d->connectionOptions = options;
-}
-
-/*!
- Sets the connection's host name to the given \a name.
-
- \sa hostName()
-*/
-void QmlSqlConnection::setHostName(const QString &name)
-{
- Q_D(QmlSqlConnection);
- d->hostName = name;
-}
-
-/*!
- Sets the connection's port number to the given \a port.
-
- \sa port()
-*/
-void QmlSqlConnection::setPort(int port)
-{
- Q_D(QmlSqlConnection);
- d->port = port;
-}
-
-/*!
- Sets the connection's user name to the given \a name.
-
- \sa userName()
-*/
-void QmlSqlConnection::setUserName(const QString &name)
-{
- Q_D(QmlSqlConnection);
- d->userName = name;
-}
-
-/*!
- Sets the connection's password to the given \a password.
-
- \sa password()
-*/
-void QmlSqlConnection::setPassword(const QString &password)
-{
- Q_D(QmlSqlConnection);
- d->password = password;
-}
-
-/*!
- Returns information about the last error that occurred on the database.
-
- Failures that occur in conjunction with an individual query are
- reported by QmlSqlQuery::lastError()
-*/
-QString QmlSqlConnection::lastError() const
-{
- return database().lastError().text();
-}
-
-/*!
- Sets the connection's driver to the specified driver \a type.
-
- \sa driver(), QSqlDatabase::addDatabase()
-*/
-void QmlSqlConnection::setDriver(const QString &type)
-{
- Q_D(QmlSqlConnection);
- d->driver = type;
-}
-
-/*!
- Returns the database object associated with this connection.
- If the database is not yet open, it will open the database
- passed on the settings specified for the SQL connection.
-*/
-QSqlDatabase QmlSqlConnection::database() const
-{
- Q_D(const QmlSqlConnection);
-
- QSqlDatabase db;
- if (QSqlDatabase::connectionNames().contains(d->name)) {
- db = QSqlDatabase::database(d->name);
- } else {
- db = QSqlDatabase::addDatabase(
- d->driver.isEmpty()
- ? QLatin1String("QSQLITE")
- : d->driver,
- d->name.isEmpty()
- ? QLatin1String(QSqlDatabase::defaultConnection)
- : d->name);
- }
- if (db.isOpen())
- return db;
- if ((d->driver.isEmpty() || d->driver == QLatin1String("QSQLITE")) &&
- qmlContext(this)) {
- // SQLITE uses files for databases, hence use relative pathing
- // if possible.
- QUrl url = qmlContext(this)->resolvedUrl(QUrl(d->databaseName));
- if (url.isRelative() || url.scheme() == QLatin1String("file"))
- db.setDatabaseName(url.toLocalFile());
- else
- db.setDatabaseName(d->databaseName);
- } else {
- db.setDatabaseName(d->databaseName);
- }
- db.setConnectOptions(d->connectionOptions);
- db.setHostName(d->hostName);
- db.setPassword(d->password);
- db.setPort(d->port);
- db.setUserName(d->userName);
- if (!db.open())
- qWarning() << "Failed to open database" << lastError();
-
- return db;
-}
-
-QT_END_NAMESPACE
diff --git a/src/declarative/extra/qmlsqlconnection.h b/src/declarative/extra/qmlsqlconnection.h
deleted file mode 100644
index 740bbc2..0000000
--- a/src/declarative/extra/qmlsqlconnection.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QMLSQLCONNECTION_H
-#define QMLSQLCONNECTION_H
-
-#include <QtDeclarative/qml.h>
-#include <QtSql/QSqlDatabase>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class QSqlDatabase;
-class QmlSqlConnectionPrivate;
-class Q_DECLARATIVE_EXPORT QmlSqlConnection : public QObject, public QmlParserStatus
-{
- Q_OBJECT
- Q_INTERFACES(QmlParserStatus)
-
- Q_PROPERTY(QString name READ name WRITE setName)
- Q_PROPERTY(QStringList tables READ tables)
- Q_PROPERTY(QString databaseName READ databaseName WRITE setDatabaseName)
- Q_PROPERTY(QString driver READ driver WRITE setDriver)
- Q_PROPERTY(QString connectOptions READ connectOptions WRITE setConnectOptions)
- Q_PROPERTY(QString hostName READ hostName WRITE setHostName)
- Q_PROPERTY(int port READ port WRITE setPort)
- Q_PROPERTY(QString userName READ userName WRITE setUserName)
- Q_PROPERTY(QString password READ password WRITE setPassword)
- Q_PROPERTY(QString lastError READ lastError)
-public:
- QmlSqlConnection(QObject *parent = 0);
- ~QmlSqlConnection();
-
- QString name() const;
- void setName(const QString &);
-
- QStringList tables() const;
-
- QString databaseName() const;
- void setDatabaseName(const QString &);
-
- QString connectOptions() const;
- void setConnectOptions(const QString &);
-
- QString hostName() const;
- void setHostName(const QString &);
-
- int port() const;
- void setPort(int);
-
- QString userName() const;
- void setUserName(const QString &);
-
- QString password() const;
- void setPassword(const QString &);
-
- QString driver() const;
- void setDriver(const QString &);
-
- QString lastError() const;
-
- QSqlDatabase database() const;
-private:
- Q_DISABLE_COPY(QmlSqlConnection)
- Q_DECLARE_PRIVATE(QmlSqlConnection)
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QmlSqlConnection)
-
-QT_END_HEADER
-
-#endif // QMLXMLLISTMODEL_H
-
diff --git a/src/declarative/extra/qmlsqlquery.cpp b/src/declarative/extra/qmlsqlquery.cpp
deleted file mode 100644
index fe6e220..0000000
--- a/src/declarative/extra/qmlsqlquery.cpp
+++ /dev/null
@@ -1,788 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qmlsqlquery.h"
-#include "qmlsqlconnection.h"
-#include "private/qobject_p.h"
-
-#include <QDebug>
-#include <QSqlQuery>
-#include <QSqlError>
-#include <QSqlField>
-#include <QSqlRecord>
-#include <QSqlDatabase>
-#include <QSqlDriver>
-
-#include <QContiguousCache>
-#include <QTimerEvent>
-
-QT_BEGIN_NAMESPACE
-
-QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,SqlBind,QmlSqlBind)
-QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,SqlQuery,QmlSqlQuery)
-
-class QmlSqlBindPrivate : public QObjectPrivate
-{
- Q_DECLARE_PUBLIC(QmlSqlBind)
-public:
- QmlSqlBindPrivate() {}
-
- QString name;
- QVariant value;
-};
-
-/*!
- \qmlclass SqlBind QmlSqlBind
- \brief The SqlBind element specifies a value binding for an SqlQuery element.
-
- By using bindings its possible to cause a SqlQuery to update itself
- when values bound through the SqlBind change. Hence in the example
- below the results for the SqlQuery will change as searchText changes.
-
- If the query is not a SELECT statement, the effects of the bound
- values will only apply when the SqlQuery exec() slot is called.
-
- \qml
- SqlQuery {
- query: "SELECT * FROM mytable WHERE name LIKE :value"
- bindings: SqlBind {
- name: ":value"
- value: searchText + '%'
- }
- }
- SqlQuery {
- query: "SELECT * FROM mytable WHERE type = ?"
- bindings: SqlBind {
- value: "simple"
- }
- }
- \endqml
-*/
-
-/*!
- \internal
- \class QmlSqlBind
- \brief The QmlSqlBind class specifies a value binding for a QmlSqlQuery.
-*/
-
-/*!
- \fn void QmlSqlBind::valueChanged()
-
- This signal is emitted when the value property of the SqlBind changes.
-*/
-
-/*!
- \qmlproperty QString SqlBind::name
-
- Defines the placeholder name of the bind. If no name is specified the
- bind will use its position within the SqlQuery's bindings to bind
- into the query.
-*/
-
-/*!
- \qmlproperty QVariant SqlBind::value
-
- Defines the value to bind into the query.
-*/
-
-/*!
- Constructs a QmlSqlVind with the given \a parent
-*/
-QmlSqlBind::QmlSqlBind(QObject *parent)
-: QObject(*(new QmlSqlBindPrivate()), parent)
-{
-}
-
-/*!
- Destroys the QmlSqlBind.
-*/
-QmlSqlBind::~QmlSqlBind()
-{
-}
-
-/*!
- Returns the binding's name.
-
- \sa setName()
-*/
-QString QmlSqlBind::name() const
-{
- Q_D(const QmlSqlBind);
- return d->name;
-}
-
-/*!
- Returns the binding's value.
-
- \sa setValue()
-*/
-QVariant QmlSqlBind::value() const
-{
- Q_D(const QmlSqlBind);
- return d->value;
-}
-
-/*!
- Sets the binding's name to the given \a name.
-
- \sa name()
-*/
-void QmlSqlBind::setName(const QString &name)
-{
- Q_D(QmlSqlBind);
- d->name = name;
-}
-
-/*!
- Sets the binding's value to the given \a value.
-
- \sa value()
-*/
-void QmlSqlBind::setValue(const QVariant &value)
-{
- Q_D(QmlSqlBind);
- if (d->value != value) {
- d->value = value;
- emit valueChanged();
- }
-}
-
-class QmlSqlQueryPrivate : public QObjectPrivate
-{
- Q_DECLARE_PUBLIC(QmlSqlQuery)
-public:
- QmlSqlQueryPrivate(QmlSqlQuery *owner)
- : isSel(false), query(NULL), requireCache(false), count(-1),
- cacheNear(100), cacheRetain(100), cacheSize(1000),
- cacheInterval(250), scheduledRow(-1), cacheTimer(-1),
- binds(owner) {}
- void prepareQuery() const;
- void bindQuery() const;
- void grabRoles() const;
-
- void clearCache();
- void initCache() const;
- void hitCache(int row) const;
-
- void enactShift(int row) const;
-
- QString queryText;
- bool isSel;
- QVariant connectionVariant;
- mutable QSqlQuery *query;
- mutable bool requireCache;
- mutable int count;
- mutable QList<int> roles;
- mutable QStringList roleNames;
-
- typedef QContiguousCache<QVariant> Column;
- mutable QVector< Column * > cache;
-
- int cacheNear, cacheRetain, cacheSize, cacheInterval;
-
- mutable int scheduledRow;
- mutable int cacheTimer;
-
- class QmlSqlBindList : public QmlList<QmlSqlBind *>
- {
- public:
- QmlSqlBindList(QmlSqlQuery *owner)
- : q(owner){}
-
- void append(QmlSqlBind *o) {
- m_contents.append(o);
- QObject::connect(o, SIGNAL(valueChanged()), q, SLOT(resetBinds()));
- }
- void clear() { m_contents.clear(); }
- int count() const { return m_contents.count(); }
- void removeAt(int pos) { return m_contents.removeAt(pos); }
- QmlSqlBind *at(int pos) const { return m_contents.at(pos); }
- void insert(int pos, QmlSqlBind *o) { m_contents.insert(pos, o); }
- private:
- QList<QmlSqlBind *> m_contents;
- QmlSqlQuery *q;
- };
-
- QmlSqlBindList binds;
-};
-
-/*!
- \qmlclass SqlQuery QmlSqlQuery
- \brief The SqlQuery element describes a query into an SQL database.
-
- The SqlQuery element has three parts. The first is the query itself,
- which can either be specified using the query property or by the
- default text for the element. The second specifies the connection
- to the database. This can either be a bound id from an SqlConnection
- or the connections name. If the connection is specified in a QML
- SqlConnection it is recommend to bind to the id to help ensure the
- database is complete before attempting to attach to it. If no
- connectoin is specified the default connection is used.
-
- It is also possible to bind values into the query using the bindings
- property. See SqlBind for more information on how to bind values into
- the query.
-
- If the query is a select statement it can be used as a model for a ListView.
- The roles will be the columns of the result set. Use the SQL AS keyword
- in the query if you want to override the column names from that of the
- table selected. You should also use the AS keyword if there is no
- appropriate table column name for the result column.
-
- \qml
- SqlQuery { connection: qmlConnectionId; query: "DELETE FROM mytable" }
- SqlQuery {
- connection: "connectionName"
- query: "SELECT * FROM mytable"
- }
- SqlQuery { query: "SELECT id AS recordId, (firstName || ' ' || lastName) AS fullName FROM mytable" }
- \endqml
-*/
-
-/*
- \class QmlSqlQuery
- \brief the QmlSqlQuery class manages a query into an SQL database.
-*/
-
-/*!
- \qmlproperty QString SqlQuery::query
-
- Defines the query text.
-*/
-
-/*!
- \qmlproperty QVariant SqlQuery::connection
-
- Defines the connection to an SQL database used by the query.
-*/
-
-/*!
- \qmlproperty QString SqlQuery::lastError
-
- Defines the last error, if one occurred, when working with the query.
-*/
-
-/*!
- \qmlproperty list<SqlBind> SqlQuery::bindings
-
- The bindings property contains the list of values to bind into the
- query. See SqlBind for more information.
-*/
-
-/*!
- Constructs a QmlSqlQuery with the given \a parent.
-*/
-QmlSqlQuery::QmlSqlQuery(QObject *parent)
-: QListModelInterface(*(new QmlSqlQueryPrivate(this)), parent)
-{
-}
-
-/*!
- Destroys the QmlSqlQuery.
-*/
-QmlSqlQuery::~QmlSqlQuery()
-{
- Q_D(QmlSqlQuery);
- if (d->query)
- delete d->query;
-}
-
-/*!
- Returns the query's bound variables.
-*/
-QmlList<QmlSqlBind *> *QmlSqlQuery::bindings()
-{
- Q_D(QmlSqlQuery);
- return &d->binds;
-}
-
-/*!
- Returns the query's bound variables.
-*/
-const QmlList<QmlSqlBind *> *QmlSqlQuery::bindings() const
-{
- Q_D(const QmlSqlQuery);
- return &d->binds;
-}
-
-/*!
- Returns the query text.
-
- \sa setQuery()
-*/
-QString QmlSqlQuery::query() const
-{
- Q_D(const QmlSqlQuery);
- return d->queryText;
-}
-
-/*!
- Sets the query text to the given \a text.
-*/
-void QmlSqlQuery::setQuery(const QString &text)
-{
- Q_D(QmlSqlQuery);
- if (text != d->queryText) {
- d->queryText = text;
-
- static const QLatin1String select("select");
- d-> isSel = text.trimmed().indexOf(select, 0, Qt::CaseInsensitive) == 0;
-
- if (d->query)
- resetQuery();
- }
-}
-
-/*!
- Returns the query's connection specifier.
-
- \sa setConnection()
-*/
-QVariant QmlSqlQuery::connection() const
-{
- Q_D(const QmlSqlQuery);
- return d->connectionVariant;
-}
-
-/*!
- Sets the query's connection specifier.
-
- \sa connection()
-*/
-void QmlSqlQuery::setConnection(const QVariant &connection)
-{
- Q_D(QmlSqlQuery);
- if (connection != d->connectionVariant) {
- d->connectionVariant = connection;
- if (d->query)
- resetQuery();
- else if (d->count == 0) // data has been requested
- d->prepareQuery();
- }
-}
-
-/*!
- Returns the set of values for a given set of requested \a roles for the
- specified \a row of the query result set. Returns an empty hash if the
- query is not a select statement.
-
- \sa count(), roles(), toString()
-*/
-QHash<int,QVariant> QmlSqlQuery::data(int row, const QList<int> &roles) const
-{
- Q_D(const QmlSqlQuery);
- if (!d->query)
- d->prepareQuery();
- QHash<int, QVariant> result;
-
- if (!d->isSel)
- return result;
-
- Q_ASSERT(row >= 0 && row <= d->count);
-
- if (!d->requireCache)
- d->query->seek(row);
- else
- d->hitCache(row);
-
- for (int i = 0; i < roles.count(); ++i) {
- int column = roles[i];
- if (d->requireCache)
- result.insert(column, d->cache[column]->at(row));
- else
- result.insert(column, d->query->value(column));
- }
- return result;
-}
-
-/*!
- Returns the number of rows in the query result set. Returns 0 if
- the query is not a select statement.
-
- \sa data(), roles(), toString()
-*/
-int QmlSqlQuery::count() const
-{
- Q_D(const QmlSqlQuery);
- if (!d->query)
- d->prepareQuery();
- return d->count;
-}
-
-/*!
- Returns the list of role integer identifiers for the query result set.
- Returns and empty list if the query is not a select statement.
-
- \sa data(), count(), toString()
-*/
-QList<int> QmlSqlQuery::roles() const
-{
- Q_D(const QmlSqlQuery);
- if (!d->query)
- d->prepareQuery();
-
- if (!d->isSel)
- return QList<int>();
-
- if (d->roleNames.isEmpty() && !d->requireCache) {
- d->query->seek(0);
- d->grabRoles();
- }
-
- return d->roles;
-}
-
-/*!
- Returns the corresponding role name for the given \a role identifier.
-
- \sa data(), roles(), toString()
-*/
-QString QmlSqlQuery::toString(int role) const
-{
- Q_D(const QmlSqlQuery);
- if (!d->query)
- d->prepareQuery();
-
- if (d->roleNames.isEmpty() && !d->requireCache) {
- d->query->seek(0);
- d->grabRoles();
- }
-
- return d->roleNames[role];
-}
-
-/*!
- Returns information about the last error that occurred on the query.
-*/
-QString QmlSqlQuery::lastError() const
-{
- Q_D(const QmlSqlQuery);
- if (d->query)
- return d->query->lastError().text();
- return QString();
-}
-
-/*!
- \reimp
-*/
-void QmlSqlQuery::componentComplete()
-{
- Q_D(QmlSqlQuery);
- if (!d->query)
- d->prepareQuery();
-}
-
-/*!
- \internal
- Rebinds the query, and if needed, emits rows inserted or rows
- added so any attached ListView elements will correctly.
-
- This slot is called automatically when the SqlBind elements in
- the bindings property of the query change.
-*/
-void QmlSqlQuery::resetBinds()
-{
- Q_D(QmlSqlQuery);
- if (!d->query)
- return;
- int oldcount = d->count;
- d->clearCache();
- d->roles.clear();
- d->roleNames.clear();
- d->bindQuery();
- if (d->isSel) {
- if (!d->query->isActive()) {
- if (!d->query->exec())
- qWarning() << "failed to execute query" << d->query->lastQuery() << d->query->boundValues() << d->query->lastError().text();
- }
- d->initCache(); // may finish query
- emitChanges(oldcount);
- }
-}
-
-/*!
- Executes the query. For SELECT statements this is normally only required
- if the database changes outside of the SQL query element. Statements that
- modify the database, such as UPDATE and INSERT, will not be applied until
- this function is called.
-*/
-void QmlSqlQuery::exec()
-{
- Q_D(QmlSqlQuery);
- if (!d->query)
- d->prepareQuery();
- Q_ASSERT(d->query);
-
- if (d->isSel) {
- int oldcount = d->count;
- d->clearCache();
- d->roles.clear();
- d->roleNames.clear();
- if (!d->query->exec())
- qWarning() << "failed to execute query" << d->query->lastQuery() << d->query->boundValues() << d->query->lastError().text();
- d->initCache(); // may finish query
- emitChanges(oldcount);
- } else {
- if (!d->query->exec())
- qWarning() << "failed to execute query" << d->query->lastQuery() << d->query->boundValues() << d->query->lastError().text();
- d->query->finish();
- }
-}
-
-/*!
- \internal
-
- Resets the query and query cache.
-*/
-void QmlSqlQuery::resetQuery()
-{
- Q_D(QmlSqlQuery);
- Q_ASSERT(d->query != 0);
- delete d->query;
- d->query = 0;
- d->clearCache();
- d->roles.clear();
- d->roleNames.clear();
- int oldcount = d->count;
- d->prepareQuery();
- emitChanges(oldcount);
-}
-
-/*!
- \internal
-
- emits row number changes based of differences between the given
- \a oldcount and the current count of the query result set.
-*/
-void QmlSqlQuery::emitChanges(int oldcount)
-{
- Q_D(QmlSqlQuery);
- if (d->count > oldcount)
- emit itemsInserted(oldcount, d->count-oldcount);
- else if (d->count < oldcount)
- emit itemsRemoved(d->count, oldcount-d->count);
- if (d->count > 0 && oldcount > 0)
- emit itemsChanged(0, qMin(d->count, oldcount), roles());
-}
-
-/*
- \internal
-
- Handles delayed caching of the query.
-*/
-void QmlSqlQuery::timerEvent(QTimerEvent *event)
-{
- Q_D(QmlSqlQuery);
- if (event->timerId() == d->cacheTimer) {
- killTimer(d->cacheTimer);
- d->cacheTimer = -1;
- d->enactShift(d->scheduledRow);
- d->scheduledRow = -1;
- }
-}
-
-/*
- Prepares the query. If the query starts with SELECT it is assumed to
- be a SELECT statement and the query is also executed.
-*/
-void QmlSqlQueryPrivate::prepareQuery() const
-{
- QObject *object = qvariant_cast<QObject*>(connectionVariant);
- QmlSqlConnection *connection = qobject_cast<QmlSqlConnection *>(object);
- QString connectionString = qvariant_cast<QString>(connectionVariant);
-
- Q_ASSERT(query == 0);
- QSqlDatabase db = connection ? connection->database()
- : QSqlDatabase::database(connectionString.isEmpty()
- ? QLatin1String(QSqlDatabase::defaultConnection)
- : connectionString, false);
-
- if (!db.isOpen()) {
- count = 0;
- return;
- }
-
- query = new QSqlQuery(db);
-
- requireCache =
- query->driver()->hasFeature(QSqlDriver::SimpleLocking)
- || !query->driver()->hasFeature(QSqlDriver::QuerySize);
-
- if (requireCache)
- query->setForwardOnly(true);
- if (!query->prepare(queryText))
- qWarning() << "failed to prepare query" << query->lastQuery() << query->lastError().text();
- bindQuery();
- if (isSel) {
- if (!query->exec())
- qWarning() << "failed to execute query" << query->lastQuery() << query->boundValues() << query->lastError().text();
- initCache();
- }
-}
-
-/*
- Binds values into the prepared query using the bindings property of the SqlQuery element.
-*/
-void QmlSqlQueryPrivate::bindQuery() const
-{
- for (int i = 0; i < binds.count(); ++i) {
- QmlSqlBind *bind = binds.at(i);
- if (bind->name().isEmpty()) {
- query->bindValue(i, bind->value());
- } else {
- query->bindValue(bind->name(), bind->value());
- }
- }
-}
-
-/*
- Clears cached query results
-*/
-void QmlSqlQueryPrivate::clearCache()
-{
- for (int i = 0; i < cache.size(); ++i)
- delete cache[i];
- cache.resize(0);
-}
-
-/*
- If caching is required, initializes the cache with
- column definitions and initial rows.
-
- Otherwise caches the count for the query.
-*/
-void QmlSqlQueryPrivate::initCache() const
-{
- if (requireCache) {
- int row = 0;
- if (query->next()) {
- if (roleNames.isEmpty()) {
- grabRoles();
- cache.resize(roleNames.count());
- for (int i = 0; i < cache.size(); ++i)
- cache[i] = new Column(cacheSize);
- }
- Q_ASSERT(cache.size() > 0);
- do {
- for (int i = 0; i < cache.size(); ++i)
- cache[i]->insert(row, query->value(i));
- row++;
- } while (!cache[0]->isFull() && query->next());
- while(query->next()) row++;
- }
- count = row;
- query->finish();
- } else {
- count = query->size();
- }
-}
-
-/*
- Schedules future background cache loading based of
- the given row.
-
- Should only be called if caching is active.
-*/
-void QmlSqlQueryPrivate::hitCache(int row) const
-{
- Q_Q(const QmlSqlQuery);
-
- Q_ASSERT(cache.size() > 0 && requireCache);
- if (cache[0]->containsIndex(row)) {
- int fi = cache[0]->firstIndex();
- int li = cache[0]->lastIndex();
- if (fi > 0 && row < fi + cacheNear)
- scheduledRow = qMax(0, row + cacheRetain - cacheSize);
- else if (li < count-1 && row > li - cacheNear)
- scheduledRow = qMax(0, row - cacheRetain);
-
- if (scheduledRow != -1 && cacheTimer == -1)
- cacheTimer = ((QmlSqlQuery *)q)->startTimer(cacheInterval);
- } else {
- if (cacheTimer != -1) {
- ((QmlSqlQuery *)q)->killTimer(cacheTimer);
- cacheTimer = -1;
- }
- scheduledRow = -1;
- qDebug() << "cache miss for row:" << row << "count:" << count;
- enactShift(row);
- }
-}
-
-/*
- Load items from sql centered around row.
-*/
-void QmlSqlQueryPrivate::enactShift(int targetRow) const
-{
- Q_ASSERT(query && cache.size());
- query->exec();
- int row = targetRow < cache[0]->firstIndex() ? targetRow : qMax(targetRow, cache[0]->lastIndex()+1);
-
- if (query->seek(row)) {
- do {
- for (int i = 0; i < cache.size(); ++i) {
- cache[i]->insert(row, query->value(i));
- }
- row++;
- } while(row < targetRow + cacheSize && query->next());
- }
-}
-
-/*
- Gets the column names for the roles of the SqlQuery element.
-
- The query must be active and on a valid row.
-*/
-void QmlSqlQueryPrivate::grabRoles() const
-{
- Q_ASSERT(query);
- Q_ASSERT(query->isValid());
- Q_ASSERT(roleNames.isEmpty());
- Q_ASSERT(roles.isEmpty());
-
- QSqlRecord record = query->record();
- for (int i = 0; i < record.count(); ++i) {
- roleNames.append(record.fieldName(i));
- roles.append(i);
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/declarative/extra/qmlsqlquery.h b/src/declarative/extra/qmlsqlquery.h
deleted file mode 100644
index 0f27709..0000000
--- a/src/declarative/extra/qmlsqlquery.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QMLSQLQUERYMODEL_H
-#define QMLSQLQUERYMODEL_H
-
-#include <QtDeclarative/qml.h>
-#include <QtDeclarative/QListModelInterface>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class QmlSqlBindPrivate;
-class Q_DECLARATIVE_EXPORT QmlSqlBind : public QObject, public QmlParserStatus
-{
- Q_OBJECT
- Q_INTERFACES(QmlParserStatus)
-
- Q_PROPERTY(QString name READ name WRITE setName)
- Q_PROPERTY(QVariant value READ value WRITE setValue)
-
- Q_CLASSINFO("DefaultValue", "value")
-
-public:
- QmlSqlBind(QObject *parent = 0);
- ~QmlSqlBind();
-
- QString name() const;
- QVariant value() const;
-
- void setName(const QString &name);
- void setValue(const QVariant &);
-
-Q_SIGNALS:
- void valueChanged();
-
-private:
- Q_DISABLE_COPY(QmlSqlBind)
- Q_DECLARE_PRIVATE(QmlSqlBind)
-};
-
-class QSqlQuery;
-class QmlSqlQueryPrivate;
-class Q_DECLARATIVE_EXPORT QmlSqlQuery : public QListModelInterface, public QmlParserStatus
-{
- Q_OBJECT
- Q_INTERFACES(QmlParserStatus)
-
- Q_PROPERTY(QString query READ query WRITE setQuery)
- Q_PROPERTY(QVariant connection READ connection WRITE setConnection)
- Q_PROPERTY(QString lastError READ lastError)
-
- Q_PROPERTY(QmlList<QmlSqlBind *> *bindings READ bindings)
-public:
- QmlSqlQuery(QObject *parent = 0);
- ~QmlSqlQuery();
-
- QString query() const;
- void setQuery(const QString &);
-
- QVariant connection() const;
- void setConnection(const QVariant &);
-
- virtual QHash<int,QVariant> data(int index, const QList<int> &roles = (QList<int>())) const;
- virtual int count() const;
- virtual QList<int> roles() const;
- virtual QString toString(int role) const;
-
- QString lastError() const;
-
- //### missing classBegin
- virtual void componentComplete();
-
- QmlList<QmlSqlBind *> *bindings();
- const QmlList<QmlSqlBind *> *bindings() const;
-
-public Q_SLOTS:
- void exec();
-
-protected:
- void timerEvent(QTimerEvent *);
-
-private Q_SLOTS:
- void resetBinds();
- void resetQuery();
-
-private:
- void emitChanges(int oldcount);
-
- Q_DISABLE_COPY(QmlSqlQuery)
- Q_DECLARE_PRIVATE(QmlSqlQuery)
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QmlSqlBind)
-QML_DECLARE_TYPE(QmlSqlQuery)
-
-QT_END_HEADER
-
-#endif
-
diff --git a/src/declarative/extra/qmlxmllistmodel.cpp b/src/declarative/extra/qmlxmllistmodel.cpp
index a3c96fd..43d7fb2 100644
--- a/src/declarative/extra/qmlxmllistmodel.cpp
+++ b/src/declarative/extra/qmlxmllistmodel.cpp
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,26 +21,25 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "qmlxmllistmodel.h"
+#include "qmlxmllistmodel_p.h"
#include "private/qobject_p.h"
#include <QtDeclarative/qmlcontext.h>
@@ -62,7 +62,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,XmlRole,QmlXmlListModelRole)
QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,XmlListModel,QmlXmlListModel)
/*!
- \qmlclass XmlRole
+ \qmlclass XmlRole QmlXmlListModelRole
\brief The XmlRole element allows you to specify a role for an XmlListModel.
*/
@@ -411,7 +411,7 @@ void QmlXmlRoleList::insert(int i, QmlXmlListModelRole *role)
*/
/*!
- \qmlclass XmlListModel
+ \qmlclass XmlListModel QmlXmlListModel
\brief The XmlListModel element allows you to specify a model using XPath expressions.
XmlListModel allows you to construct a model from XML data that can then be used as a data source
diff --git a/src/declarative/extra/qmlxmllistmodel.h b/src/declarative/extra/qmlxmllistmodel_p.h
index 1bcc008..18bf9d2 100644
--- a/src/declarative/extra/qmlxmllistmodel.h
+++ b/src/declarative/extra/qmlxmllistmodel_p.h
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,21 +21,20 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -43,7 +43,7 @@
#define QMLXMLLISTMODEL_H
#include <QtDeclarative/qml.h>
-#include <QtDeclarative/QListModelInterface>
+#include <private/qlistmodelinterface_p.h>
#include <QtDeclarative/qmlinfo.h>
QT_BEGIN_HEADER
@@ -103,7 +103,7 @@ public:
virtual void classBegin();
virtual void componentComplete();
-signals:
+Q_SIGNALS:
void statusChanged(Status);
void progressChanged(qreal progress);
void countChanged();
diff --git a/src/declarative/extra/qnumberformat.cpp b/src/declarative/extra/qnumberformat.cpp
index cde2fb0..c6a03e9 100644
--- a/src/declarative/extra/qnumberformat.cpp
+++ b/src/declarative/extra/qnumberformat.cpp
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,26 +21,25 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "qnumberformat.h"
+#include "qnumberformat_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/extra/qnumberformat.h b/src/declarative/extra/qnumberformat_p.h
index 830cf79..1a7b8e4 100644
--- a/src/declarative/extra/qnumberformat.h
+++ b/src/declarative/extra/qnumberformat_p.h
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,21 +21,20 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/