From fbc927101b8b01b30d5b776e79511165eb1bf2e1 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 23 Apr 2009 14:26:37 +1000 Subject: Split up QmlMetaProperty::write() method --- src/declarative/qml/qmlmetaproperty.cpp | 250 +++++++++++++++++++++++++++----- src/declarative/qml/qmlmetaproperty_p.h | 8 + 2 files changed, 225 insertions(+), 33 deletions(-) diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp index 79db6ce..30e0bbc 100644 --- a/src/declarative/qml/qmlmetaproperty.cpp +++ b/src/declarative/qml/qmlmetaproperty.cpp @@ -231,22 +231,28 @@ QmlMetaProperty::QmlMetaProperty(const QmlMetaProperty &other) */ QmlMetaProperty::PropertyCategory QmlMetaProperty::propertyCategory() const { - if(d->category == Unknown) { + return d->propertyCategory(); +} + +QmlMetaProperty::PropertyCategory +QmlMetaPropertyPrivate::propertyCategory() const +{ + if(category == QmlMetaProperty::Unknown) { int type = propertyType(); - if(!isValid()) - d->category = InvalidProperty; + if(type == QmlMetaProperty::Invalid) + category = QmlMetaProperty::InvalidProperty; else if(type == qMetaTypeId()) - d->category = Bindable; + category = QmlMetaProperty::Bindable; else if(QmlMetaType::isList(type)) - d->category = List; + category = QmlMetaProperty::List; else if(QmlMetaType::isQmlList(type)) - d->category = QmlList; + category = QmlMetaProperty::QmlList; else if(QmlMetaType::isObject(type)) - d->category = Object; + category = QmlMetaProperty::Object; else - d->category = Normal; + category = QmlMetaProperty::Normal; } - return d->category; + return category; } /*! @@ -310,14 +316,19 @@ bool QmlMetaProperty::operator==(const QmlMetaProperty &other) const */ int QmlMetaProperty::propertyType() const { + return d->propertyType(); +} + +int QmlMetaPropertyPrivate::propertyType() const +{ int rv = QVariant::Invalid; - if(d->prop.name()) { - if(d->propType == (int)QVariant::LastType) + if(prop.name()) { + if(propType == (int)QVariant::LastType) rv = qMetaTypeId(); else - rv = d->propType; - } else if(d->attachedFunc) { + rv = propType; + } else if(attachedFunc) { rv = qMetaTypeId(); } @@ -532,34 +543,207 @@ QVariant QmlMetaProperty::read() const } Q_DECLARE_METATYPE(QList); -/*! - Set the property value to \a value. -*/ -void QmlMetaProperty::write(const QVariant &value) const + +void QmlMetaPropertyPrivate::writeSignalProperty(const QVariant &value) { - if(type() & SignalProperty) { + QString expr = value.toString(); + const QObjectList &children = object->children(); + + for(int ii = 0; ii < children.count(); ++ii) { + QmlBoundSignal *sig = qobject_cast(children.at(ii)); + if(sig && sig->index() == coreIdx) { + if(expr.isEmpty()) { + sig->disconnect(); + sig->deleteLater(); + } else { + sig->setExpression(expr); + } + return; + } + } - QString expr = value.toString(); - const QObjectList &children = object()->children(); + if(!expr.isEmpty()) { + // XXX scope + (void *)new QmlBoundSignal(QmlContext::activeContext(), expr, object, + coreIdx, object); + } +} - for(int ii = 0; ii < children.count(); ++ii) { - QmlBoundSignal *sig = qobject_cast(children.at(ii)); - if(sig && sig->index() == d->coreIdx) { - if(expr.isEmpty()) { - sig->disconnect(); - sig->deleteLater(); - } else { - sig->setExpression(expr); +void QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value) +{ + if(prop.isEnumType()) { + QVariant v = value; + if (value.type() == QVariant::Double) { //enum values come through the script engine as doubles + double integral; + double fractional = modf(value.toDouble(), &integral); + if (qFuzzyCompare(fractional, (double)0.0)) + v.convert(QVariant::Int); + } + prop.write(object, v); + } else { + if(!value.isValid()) + return; + + int t = propertyType(); + int vt = value.type(); + + if(vt == t || + value.userType() == t) { + + void *a[1]; + a[0] = (void *)value.constData(); + QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, a); + + } else if(qMetaTypeId() == t) { + + prop.write(object, value); + + } else if(propertyCategory() == QmlMetaProperty::Object) { + + QObject *o = QmlMetaType::toQObject(value); + if(o) + prop.write(object, QmlMetaType::fromObject(o, propertyType())); + + } else if (propertyCategory() == QmlMetaProperty::List) { + + int listType = QmlMetaType::listType(t); + if(value.userType() == qMetaTypeId >()) { + const QList &list = + qvariant_cast >(value); + QVariant listVar = prop.read(object); + QmlMetaType::clear(listVar); + for(int ii = 0; ii < list.count(); ++ii) { + QVariant v = QmlMetaType::fromObject(list.at(ii), listType); + QmlMetaType::append(listVar, v); + } + + } else if(vt == listType || + value.userType() == listType) { + QVariant listVar = prop.read(object); + if (!QmlMetaType::append(listVar, value)) { + qWarning() << "QmlMetaProperty: Unable to assign object to list"; } - return; } - } + } else if (propertyCategory() == QmlMetaProperty::QmlList) { + // XXX - optimize! + QVariant list = prop.read(object); + QmlPrivate::ListInterface *li = + *(QmlPrivate::ListInterface **)list.constData(); + + int type = li->type(); + + if (QObject *obj = QmlMetaType::toQObject(value)) { + const QMetaObject *mo = + QmlMetaType::rawMetaObjectForType(type); + + const QMetaObject *objMo = obj->metaObject(); + bool found = false; + while(!found && objMo) { + if(objMo == mo) + found = true; + else + objMo = objMo->superClass(); + } + + if(!found) { + qWarning() << "Unable to assign object to list"; + return; + } + + // NOTE: This assumes a cast to QObject does not alter + // the object pointer + void *d = (void *)&obj; + li->append(d); + } + } else if(propertyCategory() == QmlMetaProperty::Normal) { + + switch(t) { + case QVariant::Double: + { + qreal r; + bool found = true; + if(vt == QVariant::Int) { + r = value.toInt(); + } else if(vt == QVariant::UInt) { + r = value.toUInt(); + } else { + found = false; + } - if(!expr.isEmpty()) { - // XXX scope - (void *)new QmlBoundSignal(QmlContext::activeContext(), expr, object(), d->coreIdx, object()); + if(found) { + void *a[1]; + a[0] = &r; + QMetaObject::metacall(object, + QMetaObject::WriteProperty, + coreIdx, a); + return; + } + } + break; + + case QVariant::Int: + { + int i; + bool found = true; + if(vt == QVariant::Double) { + i = (int)value.toDouble(); + } else if(vt == QVariant::UInt) { + i = (int)value.toUInt(); + } else { + found = false; + } + + if(found) { + void *a[1]; + a[0] = &i; + QMetaObject::metacall(object, + QMetaObject::WriteProperty, + coreIdx, a); + return; + } + } + break; + + case QVariant::String: + { + QString s; + bool found = true; + if(vt == QVariant::ByteArray) { + s = QLatin1String(value.toByteArray()); + } else { + found = false; + } + + if(found) { + void *a[1]; + a[0] = &s; + QMetaObject::metacall(object, + QMetaObject::WriteProperty, + coreIdx, a); + return; + } + } + break; + + + default: + break; + } + prop.write(object, value); } + } +} + +/*! + Set the property value to \a value. +*/ +void QmlMetaProperty::write(const QVariant &value) const +{ + if(type() & SignalProperty) { + + d->writeSignalProperty(value); + } else if(d->prop.name()) { if(d->prop.isEnumType()) { diff --git a/src/declarative/qml/qmlmetaproperty_p.h b/src/declarative/qml/qmlmetaproperty_p.h index 5c13f5e..1ea38e9 100644 --- a/src/declarative/qml/qmlmetaproperty_p.h +++ b/src/declarative/qml/qmlmetaproperty_p.h @@ -42,6 +42,8 @@ #ifndef QMLMETAPROPERTY_P_H #define QMLMETAPROPERTY_P_H +#include "qmlmetaproperty.h" + class QmlContext; class QmlMetaPropertyPrivate { @@ -69,6 +71,12 @@ public: QObject *attachedObject() const; void findSignalInt(QObject *, const QString &); + + int propertyType() const; + QmlMetaProperty::PropertyCategory propertyCategory() const; + + void writeSignalProperty(const QVariant &); + void writeValueProperty(const QVariant &); }; #endif // QMLMETAPROPERTY_P_H -- cgit v0.12 From 161cf1f17eabd87e46c2056af731174e930883dd Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 23 Apr 2009 16:52:07 +1000 Subject: Add a Follow::followValue property --- src/declarative/util/qmlfollow.cpp | 16 ++++++++++++++++ src/declarative/util/qmlfollow.h | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/src/declarative/util/qmlfollow.cpp b/src/declarative/util/qmlfollow.cpp index c841b85..01d8962 100644 --- a/src/declarative/util/qmlfollow.cpp +++ b/src/declarative/util/qmlfollow.cpp @@ -52,6 +52,7 @@ QML_DEFINE_TYPE(QmlFollow,Follow); class QmlFollowPrivate : public QObjectPrivate { + Q_DECLARE_PUBLIC(QmlFollow) public: QmlFollowPrivate() : sourceValue(0), maxVelocity(0), lastTime(0) @@ -86,6 +87,8 @@ public: void QmlFollowPrivate::tick(int time) { + Q_Q(QmlFollow); + int elapsed = time - lastTime; if (!elapsed) return; @@ -133,6 +136,7 @@ void QmlFollowPrivate::tick(int time) } lastTime = time; } + emit q->valueChanged(currentValue); property.write(currentValue); } @@ -288,6 +292,11 @@ void QmlFollow::setDamping(qreal damping) } /*! + \qmlproperty qreal Follow::followValue + The current value. +*/ + +/*! \qmlproperty bool Follow::enabled This property holds whether the target will track the source. */ @@ -306,4 +315,11 @@ void QmlFollow::setEnabled(bool enabled) else d->stop(); } + +qreal QmlFollow::value() const +{ + Q_D(const QmlFollow); + return d->currentValue; +} + QT_END_NAMESPACE diff --git a/src/declarative/util/qmlfollow.h b/src/declarative/util/qmlfollow.h index a609305..aac4c01 100644 --- a/src/declarative/util/qmlfollow.h +++ b/src/declarative/util/qmlfollow.h @@ -65,6 +65,7 @@ class Q_DECLARATIVE_EXPORT QmlFollow : public QmlPropertyValueSource, Q_PROPERTY(qreal damping READ damping WRITE setDamping); Q_PROPERTY(bool enabled READ enabled WRITE setEnabled); + Q_PROPERTY(qreal followValue READ value NOTIFY valueChanged); public: QmlFollow(QObject *parent=0); ~QmlFollow(); @@ -81,6 +82,11 @@ public: void setDamping(qreal damping); bool enabled() const; void setEnabled(bool enabled); + + qreal value() const; + +Q_SIGNALS: + void valueChanged(qreal); }; QML_DECLARE_TYPE(QmlFollow); -- cgit v0.12 From 8d780fa24d1ea335ba31c09c775b90d57f7f4be2 Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Thu, 23 Apr 2009 13:08:40 +0200 Subject: Update copyright headers of animation examples --- examples/animation/animatedtiles/main.cpp | 41 +++++++++++++++++++++ examples/animation/appchooser/main.cpp | 36 ++++++++++++++++-- examples/animation/easing/animation.h | 34 ++++++++++++++++- examples/animation/easing/main.cpp | 36 ++++++++++++++++-- examples/animation/easing/window.cpp | 36 ++++++++++++++++-- examples/animation/easing/window.h | 36 ++++++++++++++++-- examples/animation/example/main.cpp | 36 ++++++++++++++++-- examples/animation/example/mainwindow.cpp | 36 ++++++++++++++++-- examples/animation/example/mainwindow.h | 36 ++++++++++++++++-- examples/animation/moveblocks/main.cpp | 36 ++++++++++++++++-- examples/animation/padnavigator-ng/main.cpp | 36 ++++++++++++++++-- examples/animation/padnavigator-ng/panel.cpp | 36 ++++++++++++++++-- examples/animation/padnavigator-ng/panel.h | 36 ++++++++++++++++-- .../animation/padnavigator-ng/roundrectitem.cpp | 36 ++++++++++++++++-- examples/animation/padnavigator-ng/roundrectitem.h | 36 ++++++++++++++++-- examples/animation/padnavigator-ng/splashitem.cpp | 36 ++++++++++++++++-- examples/animation/padnavigator-ng/splashitem.h | 36 ++++++++++++++++-- examples/animation/photobrowser/main.cpp | 36 ++++++++++++++++-- examples/animation/photobrowser/menu.cpp | 36 ++++++++++++++++-- examples/animation/photobrowser/menu.h | 36 ++++++++++++++++-- examples/animation/photobrowser/river.cpp | 36 ++++++++++++++++-- examples/animation/photobrowser/river.h | 36 ++++++++++++++++-- examples/animation/photobrowser/riveritem.cpp | 36 ++++++++++++++++-- examples/animation/photobrowser/riveritem.h | 36 ++++++++++++++++-- examples/animation/piemenu/main.cpp | 36 ++++++++++++++++-- examples/animation/piemenu/qgraphicspiemenu.cpp | 36 ++++++++++++++++-- examples/animation/piemenu/qgraphicspiemenu.h | 36 ++++++++++++++++-- examples/animation/piemenu/qgraphicspiemenu_p.h | 36 ++++++++++++++++-- .../animation/piemenu/qgraphicspiemenusection_p.h | 36 ++++++++++++++++-- examples/animation/piemenu/scene.cpp | 36 ++++++++++++++++-- examples/animation/piemenu/scene.h | 36 ++++++++++++++++-- .../animation/research/memberfunctions/main.cpp | 41 +++++++++++++++++++++ .../research/memberfunctions/qvalueanimation.cpp | 38 ++++++++++++++++--- .../research/memberfunctions/qvalueanimation.h | 36 ++++++++++++++++-- .../research/memberfunctions/qvalueanimation_p.h | 36 ++++++++++++++++-- .../animation/research/propertytransform/main.cpp | 41 +++++++++++++++++++++ .../propertytransform/qpropertytransform.h | 41 +++++++++++++++++++++ examples/animation/research/sound/main.cpp | 38 +++++++++++++++++-- examples/animation/states/main.cpp | 36 ++++++++++++++++-- examples/animation/stickman/animation.cpp | 43 +++++++++++++++++++++- examples/animation/stickman/animation.h | 41 +++++++++++++++++++++ .../animation/stickman/editor/animationdialog.cpp | 43 +++++++++++++++++++++- .../animation/stickman/editor/animationdialog.h | 41 +++++++++++++++++++++ examples/animation/stickman/editor/mainwindow.cpp | 41 +++++++++++++++++++++ examples/animation/stickman/editor/mainwindow.h | 41 +++++++++++++++++++++ examples/animation/stickman/graphicsview.cpp | 41 +++++++++++++++++++++ examples/animation/stickman/graphicsview.h | 41 +++++++++++++++++++++ examples/animation/stickman/lifecycle.cpp | 41 +++++++++++++++++++++ examples/animation/stickman/lifecycle.h | 41 +++++++++++++++++++++ examples/animation/stickman/main.cpp | 41 +++++++++++++++++++++ examples/animation/stickman/node.cpp | 43 +++++++++++++++++++++- examples/animation/stickman/node.h | 41 +++++++++++++++++++++ examples/animation/stickman/stickman.cpp | 41 +++++++++++++++++++++ examples/animation/stickman/stickman.h | 41 +++++++++++++++++++++ 54 files changed, 1937 insertions(+), 110 deletions(-) diff --git a/examples/animation/animatedtiles/main.cpp b/examples/animation/animatedtiles/main.cpp index 9b0b0a5..a97eaf3 100644 --- a/examples/animation/animatedtiles/main.cpp +++ b/examples/animation/animatedtiles/main.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 #ifdef QT_EXPERIMENTAL_SOLUTION # include "qgraphicswidget.h" diff --git a/examples/animation/appchooser/main.cpp b/examples/animation/appchooser/main.cpp index 1a43ed7..7573347 100644 --- a/examples/animation/appchooser/main.cpp +++ b/examples/animation/appchooser/main.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/easing/animation.h b/examples/animation/easing/animation.h index db67810..c9472e1 100644 --- a/examples/animation/easing/animation.h +++ b/examples/animation/easing/animation.h @@ -3,9 +3,39 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/easing/main.cpp b/examples/animation/easing/main.cpp index 139f2da..487fa86 100644 --- a/examples/animation/easing/main.cpp +++ b/examples/animation/easing/main.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/easing/window.cpp b/examples/animation/easing/window.cpp index bb45770..cf4be15 100644 --- a/examples/animation/easing/window.cpp +++ b/examples/animation/easing/window.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/easing/window.h b/examples/animation/easing/window.h index 4ba6eb6..f3a8cb3 100644 --- a/examples/animation/easing/window.h +++ b/examples/animation/easing/window.h @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/example/main.cpp b/examples/animation/example/main.cpp index d5f5607..1180b4f 100644 --- a/examples/animation/example/main.cpp +++ b/examples/animation/example/main.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/example/mainwindow.cpp b/examples/animation/example/mainwindow.cpp index 2b0e035..3770513 100644 --- a/examples/animation/example/mainwindow.cpp +++ b/examples/animation/example/mainwindow.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/example/mainwindow.h b/examples/animation/example/mainwindow.h index 6be7463..163eb89 100644 --- a/examples/animation/example/mainwindow.h +++ b/examples/animation/example/mainwindow.h @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/moveblocks/main.cpp b/examples/animation/moveblocks/main.cpp index 1f253f3..076da59 100644 --- a/examples/animation/moveblocks/main.cpp +++ b/examples/animation/moveblocks/main.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/padnavigator-ng/main.cpp b/examples/animation/padnavigator-ng/main.cpp index 5b35b62..f8b167f 100644 --- a/examples/animation/padnavigator-ng/main.cpp +++ b/examples/animation/padnavigator-ng/main.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/padnavigator-ng/panel.cpp b/examples/animation/padnavigator-ng/panel.cpp index 94dbdec..e61be0e 100644 --- a/examples/animation/padnavigator-ng/panel.cpp +++ b/examples/animation/padnavigator-ng/panel.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/padnavigator-ng/panel.h b/examples/animation/padnavigator-ng/panel.h index cbceed1..35d0db5 100644 --- a/examples/animation/padnavigator-ng/panel.h +++ b/examples/animation/padnavigator-ng/panel.h @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/padnavigator-ng/roundrectitem.cpp b/examples/animation/padnavigator-ng/roundrectitem.cpp index e498538..7e7d423 100644 --- a/examples/animation/padnavigator-ng/roundrectitem.cpp +++ b/examples/animation/padnavigator-ng/roundrectitem.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/padnavigator-ng/roundrectitem.h b/examples/animation/padnavigator-ng/roundrectitem.h index 56a6d3c..fb142c6 100644 --- a/examples/animation/padnavigator-ng/roundrectitem.h +++ b/examples/animation/padnavigator-ng/roundrectitem.h @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/padnavigator-ng/splashitem.cpp b/examples/animation/padnavigator-ng/splashitem.cpp index 84a8945..1264987 100644 --- a/examples/animation/padnavigator-ng/splashitem.cpp +++ b/examples/animation/padnavigator-ng/splashitem.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/padnavigator-ng/splashitem.h b/examples/animation/padnavigator-ng/splashitem.h index 6428b69..05ff040 100644 --- a/examples/animation/padnavigator-ng/splashitem.h +++ b/examples/animation/padnavigator-ng/splashitem.h @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/photobrowser/main.cpp b/examples/animation/photobrowser/main.cpp index 98f2a9e..d5ab2a3 100644 --- a/examples/animation/photobrowser/main.cpp +++ b/examples/animation/photobrowser/main.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/photobrowser/menu.cpp b/examples/animation/photobrowser/menu.cpp index d4efe9c..97493ba 100644 --- a/examples/animation/photobrowser/menu.cpp +++ b/examples/animation/photobrowser/menu.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/photobrowser/menu.h b/examples/animation/photobrowser/menu.h index 9514cfe..3bdfe45 100644 --- a/examples/animation/photobrowser/menu.h +++ b/examples/animation/photobrowser/menu.h @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/photobrowser/river.cpp b/examples/animation/photobrowser/river.cpp index f3dd0746..6760066 100644 --- a/examples/animation/photobrowser/river.cpp +++ b/examples/animation/photobrowser/river.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/photobrowser/river.h b/examples/animation/photobrowser/river.h index 25bf62a..d6bfc76 100644 --- a/examples/animation/photobrowser/river.h +++ b/examples/animation/photobrowser/river.h @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/photobrowser/riveritem.cpp b/examples/animation/photobrowser/riveritem.cpp index f6523a7..9692d30 100644 --- a/examples/animation/photobrowser/riveritem.cpp +++ b/examples/animation/photobrowser/riveritem.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/photobrowser/riveritem.h b/examples/animation/photobrowser/riveritem.h index 39fdcc2..2023c44 100644 --- a/examples/animation/photobrowser/riveritem.h +++ b/examples/animation/photobrowser/riveritem.h @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/piemenu/main.cpp b/examples/animation/piemenu/main.cpp index 28f62d0..8076da8 100644 --- a/examples/animation/piemenu/main.cpp +++ b/examples/animation/piemenu/main.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/piemenu/qgraphicspiemenu.cpp b/examples/animation/piemenu/qgraphicspiemenu.cpp index c913423..a199119 100644 --- a/examples/animation/piemenu/qgraphicspiemenu.cpp +++ b/examples/animation/piemenu/qgraphicspiemenu.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/piemenu/qgraphicspiemenu.h b/examples/animation/piemenu/qgraphicspiemenu.h index 68b4ba9..d784f93 100644 --- a/examples/animation/piemenu/qgraphicspiemenu.h +++ b/examples/animation/piemenu/qgraphicspiemenu.h @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/piemenu/qgraphicspiemenu_p.h b/examples/animation/piemenu/qgraphicspiemenu_p.h index 87a749c..458b8f1 100644 --- a/examples/animation/piemenu/qgraphicspiemenu_p.h +++ b/examples/animation/piemenu/qgraphicspiemenu_p.h @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/piemenu/qgraphicspiemenusection_p.h b/examples/animation/piemenu/qgraphicspiemenusection_p.h index 328f742..2d71a06 100644 --- a/examples/animation/piemenu/qgraphicspiemenusection_p.h +++ b/examples/animation/piemenu/qgraphicspiemenusection_p.h @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/piemenu/scene.cpp b/examples/animation/piemenu/scene.cpp index 08aad06..6309975 100644 --- a/examples/animation/piemenu/scene.cpp +++ b/examples/animation/piemenu/scene.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/piemenu/scene.h b/examples/animation/piemenu/scene.h index 676f55f..bbfe6d3 100644 --- a/examples/animation/piemenu/scene.h +++ b/examples/animation/piemenu/scene.h @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/research/memberfunctions/main.cpp b/examples/animation/research/memberfunctions/main.cpp index 9142f29..2663f9c 100644 --- a/examples/animation/research/memberfunctions/main.cpp +++ b/examples/animation/research/memberfunctions/main.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 #include "qvalueanimation.h" diff --git a/examples/animation/research/memberfunctions/qvalueanimation.cpp b/examples/animation/research/memberfunctions/qvalueanimation.cpp index 58652ba..de0b8ff 100644 --- a/examples/animation/research/memberfunctions/qvalueanimation.cpp +++ b/examples/animation/research/memberfunctions/qvalueanimation.cpp @@ -1,16 +1,44 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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 "qvalueanimation.h" #include "qvalueanimation_p.h" diff --git a/examples/animation/research/memberfunctions/qvalueanimation.h b/examples/animation/research/memberfunctions/qvalueanimation.h index a4aa213..55c4993 100644 --- a/examples/animation/research/memberfunctions/qvalueanimation.h +++ b/examples/animation/research/memberfunctions/qvalueanimation.h @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/research/memberfunctions/qvalueanimation_p.h b/examples/animation/research/memberfunctions/qvalueanimation_p.h index e6e7682..55c8ce1 100644 --- a/examples/animation/research/memberfunctions/qvalueanimation_p.h +++ b/examples/animation/research/memberfunctions/qvalueanimation_p.h @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/research/propertytransform/main.cpp b/examples/animation/research/propertytransform/main.cpp index 80002c9..99cd769 100644 --- a/examples/animation/research/propertytransform/main.cpp +++ b/examples/animation/research/propertytransform/main.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 #include "qpropertytransform.h" diff --git a/examples/animation/research/propertytransform/qpropertytransform.h b/examples/animation/research/propertytransform/qpropertytransform.h index e052625..e27987f 100644 --- a/examples/animation/research/propertytransform/qpropertytransform.h +++ b/examples/animation/research/propertytransform/qpropertytransform.h @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 #include #include diff --git a/examples/animation/research/sound/main.cpp b/examples/animation/research/sound/main.cpp index 2c9fa47..ffbc44c 100644 --- a/examples/animation/research/sound/main.cpp +++ b/examples/animation/research/sound/main.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ @@ -71,4 +101,4 @@ int main(int argc, char **argv) anim.start(); return app.exec(); -} \ No newline at end of file +} diff --git a/examples/animation/states/main.cpp b/examples/animation/states/main.cpp index da50519..06b0667 100644 --- a/examples/animation/states/main.cpp +++ b/examples/animation/states/main.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/examples/animation/stickman/animation.cpp b/examples/animation/stickman/animation.cpp index 998632a..c2c6bd1 100644 --- a/examples/animation/stickman/animation.cpp +++ b/examples/animation/stickman/animation.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 "animation.h" #include @@ -149,4 +190,4 @@ void Animation::load(QIODevice *device) m_frames.append(frame); } -} \ No newline at end of file +} diff --git a/examples/animation/stickman/animation.h b/examples/animation/stickman/animation.h index 22afab6..e6c375e 100644 --- a/examples/animation/stickman/animation.h +++ b/examples/animation/stickman/animation.h @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 ANIMATION_H #define ANIMATION_H diff --git a/examples/animation/stickman/editor/animationdialog.cpp b/examples/animation/stickman/editor/animationdialog.cpp index ca0daf0..441517d 100644 --- a/examples/animation/stickman/editor/animationdialog.cpp +++ b/examples/animation/stickman/editor/animationdialog.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 "animationdialog.h" #include "stickman.h" #include "animation.h" @@ -148,4 +189,4 @@ void AnimationDialog::totalFramesChanged(int totalFrames) void AnimationDialog::setCurrentAnimationName(const QString &name) { m_animation->setName(name); -} \ No newline at end of file +} diff --git a/examples/animation/stickman/editor/animationdialog.h b/examples/animation/stickman/editor/animationdialog.h index c144fd8..764cdaf 100644 --- a/examples/animation/stickman/editor/animationdialog.h +++ b/examples/animation/stickman/editor/animationdialog.h @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 ANIMATIONDIALOG_H #define ANIMATIONDIALOG_H diff --git a/examples/animation/stickman/editor/mainwindow.cpp b/examples/animation/stickman/editor/mainwindow.cpp index 158c9b7..c6464c6 100644 --- a/examples/animation/stickman/editor/mainwindow.cpp +++ b/examples/animation/stickman/editor/mainwindow.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 "mainwindow.h" #include "animationdialog.h" #include "stickman.h" diff --git a/examples/animation/stickman/editor/mainwindow.h b/examples/animation/stickman/editor/mainwindow.h index 279fc07..4c2b949 100644 --- a/examples/animation/stickman/editor/mainwindow.h +++ b/examples/animation/stickman/editor/mainwindow.h @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 MAINWINDOW_H #define MAINWINDOW_H diff --git a/examples/animation/stickman/graphicsview.cpp b/examples/animation/stickman/graphicsview.cpp index d4f0e3a..754f3bc 100644 --- a/examples/animation/stickman/graphicsview.cpp +++ b/examples/animation/stickman/graphicsview.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 "graphicsview.h" #include "editor/mainwindow.h" #include "stickman.h" diff --git a/examples/animation/stickman/graphicsview.h b/examples/animation/stickman/graphicsview.h index 58ed95b..2515418 100644 --- a/examples/animation/stickman/graphicsview.h +++ b/examples/animation/stickman/graphicsview.h @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 GRAPHICSVIEW_H #define GRAPHICSVIEW diff --git a/examples/animation/stickman/lifecycle.cpp b/examples/animation/stickman/lifecycle.cpp index 9233760..4f2ac6d 100644 --- a/examples/animation/stickman/lifecycle.cpp +++ b/examples/animation/stickman/lifecycle.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 "lifecycle.h" #include "stickman.h" #include "node.h" diff --git a/examples/animation/stickman/lifecycle.h b/examples/animation/stickman/lifecycle.h index 437e935..4ca6ffd 100644 --- a/examples/animation/stickman/lifecycle.h +++ b/examples/animation/stickman/lifecycle.h @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 LIFECYCLE_H #define LIFECYCLE_H diff --git a/examples/animation/stickman/main.cpp b/examples/animation/stickman/main.cpp index 62860ec..6ff437d 100644 --- a/examples/animation/stickman/main.cpp +++ b/examples/animation/stickman/main.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 "animation.h" #include "node.h" #include "lifecycle.h" diff --git a/examples/animation/stickman/node.cpp b/examples/animation/stickman/node.cpp index 5932b60..ed18108 100644 --- a/examples/animation/stickman/node.cpp +++ b/examples/animation/stickman/node.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 "node.h" #include "stickman.h" @@ -48,4 +89,4 @@ void Node::mouseMoveEvent(QGraphicsSceneMouseEvent *event) void Node::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { m_dragging = false; -} \ No newline at end of file +} diff --git a/examples/animation/stickman/node.h b/examples/animation/stickman/node.h index e9e9190..72eae87 100644 --- a/examples/animation/stickman/node.h +++ b/examples/animation/stickman/node.h @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 NODE_H #define NODE_H diff --git a/examples/animation/stickman/stickman.cpp b/examples/animation/stickman/stickman.cpp index 1393836..5eb392f 100644 --- a/examples/animation/stickman/stickman.cpp +++ b/examples/animation/stickman/stickman.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 "stickman.h" #include "node.h" diff --git a/examples/animation/stickman/stickman.h b/examples/animation/stickman/stickman.h index e659cdb..46863a3 100644 --- a/examples/animation/stickman/stickman.h +++ b/examples/animation/stickman/stickman.h @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 STICKMAN_H #define STICKMAN_H -- cgit v0.12 From 79292e43fe8f5e59e26767af4f4d053794361b76 Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Thu, 23 Apr 2009 14:13:40 +0200 Subject: Moved the animation examples piemenu and photobrowser to examples/research --- examples/animation/photobrowser/main.cpp | 82 --- examples/animation/photobrowser/menu.cpp | 155 ------ examples/animation/photobrowser/menu.h | 80 --- examples/animation/photobrowser/photobrowser.pro | 17 - examples/animation/photobrowser/river.cpp | 591 --------------------- examples/animation/photobrowser/river.h | 111 ---- examples/animation/photobrowser/riveritem.cpp | 125 ----- examples/animation/photobrowser/riveritem.h | 66 --- examples/animation/piemenu/main.cpp | 56 -- examples/animation/piemenu/piemenu.pro | 8 - examples/animation/piemenu/qgraphicspiemenu.cpp | 250 --------- examples/animation/piemenu/qgraphicspiemenu.h | 104 ---- examples/animation/piemenu/qgraphicspiemenu_p.h | 78 --- .../animation/piemenu/qgraphicspiemenusection_p.h | 88 --- examples/animation/piemenu/scene.cpp | 73 --- examples/animation/piemenu/scene.h | 60 --- examples/animation/research/photobrowser/main.cpp | 82 +++ examples/animation/research/photobrowser/menu.cpp | 155 ++++++ examples/animation/research/photobrowser/menu.h | 80 +++ .../research/photobrowser/photobrowser.pro | 17 + examples/animation/research/photobrowser/river.cpp | 591 +++++++++++++++++++++ examples/animation/research/photobrowser/river.h | 111 ++++ .../animation/research/photobrowser/riveritem.cpp | 125 +++++ .../animation/research/photobrowser/riveritem.h | 66 +++ examples/animation/research/piemenu/main.cpp | 56 ++ examples/animation/research/piemenu/piemenu.pro | 8 + .../research/piemenu/qgraphicspiemenu.cpp | 250 +++++++++ .../animation/research/piemenu/qgraphicspiemenu.h | 104 ++++ .../research/piemenu/qgraphicspiemenu_p.h | 78 +++ .../research/piemenu/qgraphicspiemenusection_p.h | 88 +++ examples/animation/research/piemenu/scene.cpp | 73 +++ examples/animation/research/piemenu/scene.h | 60 +++ 32 files changed, 1944 insertions(+), 1944 deletions(-) delete mode 100644 examples/animation/photobrowser/main.cpp delete mode 100644 examples/animation/photobrowser/menu.cpp delete mode 100644 examples/animation/photobrowser/menu.h delete mode 100644 examples/animation/photobrowser/photobrowser.pro delete mode 100644 examples/animation/photobrowser/river.cpp delete mode 100644 examples/animation/photobrowser/river.h delete mode 100644 examples/animation/photobrowser/riveritem.cpp delete mode 100644 examples/animation/photobrowser/riveritem.h delete mode 100644 examples/animation/piemenu/main.cpp delete mode 100644 examples/animation/piemenu/piemenu.pro delete mode 100644 examples/animation/piemenu/qgraphicspiemenu.cpp delete mode 100644 examples/animation/piemenu/qgraphicspiemenu.h delete mode 100644 examples/animation/piemenu/qgraphicspiemenu_p.h delete mode 100644 examples/animation/piemenu/qgraphicspiemenusection_p.h delete mode 100644 examples/animation/piemenu/scene.cpp delete mode 100644 examples/animation/piemenu/scene.h create mode 100644 examples/animation/research/photobrowser/main.cpp create mode 100644 examples/animation/research/photobrowser/menu.cpp create mode 100644 examples/animation/research/photobrowser/menu.h create mode 100644 examples/animation/research/photobrowser/photobrowser.pro create mode 100644 examples/animation/research/photobrowser/river.cpp create mode 100644 examples/animation/research/photobrowser/river.h create mode 100644 examples/animation/research/photobrowser/riveritem.cpp create mode 100644 examples/animation/research/photobrowser/riveritem.h create mode 100644 examples/animation/research/piemenu/main.cpp create mode 100644 examples/animation/research/piemenu/piemenu.pro create mode 100644 examples/animation/research/piemenu/qgraphicspiemenu.cpp create mode 100644 examples/animation/research/piemenu/qgraphicspiemenu.h create mode 100644 examples/animation/research/piemenu/qgraphicspiemenu_p.h create mode 100644 examples/animation/research/piemenu/qgraphicspiemenusection_p.h create mode 100644 examples/animation/research/piemenu/scene.cpp create mode 100644 examples/animation/research/piemenu/scene.h diff --git a/examples/animation/photobrowser/main.cpp b/examples/animation/photobrowser/main.cpp deleted file mode 100644 index d5ab2a3..0000000 --- a/examples/animation/photobrowser/main.cpp +++ /dev/null @@ -1,82 +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 QtCore 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 - -#include "river.h" -#include "menu.h" - -int main(int argc, char **argv) -{ - QApplication app(argc, argv); - if (app.arguments().size() == 1) { - qWarning("you have to specifiy a path to look for the photos"); - return 0; - } - - - QGraphicsScene scene; - scene.setSceneRect(QRectF(QPointF(), River::fixedSize())); - - QGraphicsView view(&scene); - view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - - const int fw = view.frameWidth() * 2; - view.setFixedSize(River::fixedSize() + QSize(fw,fw)); - - River river(app.arguments()[1]); - scene.addItem(&river); - - Menu menu(&river); - menu.addAction(QLatin1String("River Mode"), &river, SLOT(setRiverMode())); - menu.addAction(QLatin1String("Grid Mode"), &river, SLOT(setGridMode())); - menu.addAction(QLatin1String("Cover Flow"), &river, SLOT(setCoverMode())); - menu.addAction(QLatin1String("Hide Menu"), &menu, SLOT(hide())); - menu.addAction(QLatin1String("Exit"), &app, SLOT(quit())); - menu.setZValue(2); - menu.setFocus(); - - river.menu = &menu; - view.show(); - - return app.exec(); -} diff --git a/examples/animation/photobrowser/menu.cpp b/examples/animation/photobrowser/menu.cpp deleted file mode 100644 index 97493ba..0000000 --- a/examples/animation/photobrowser/menu.cpp +++ /dev/null @@ -1,155 +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 QtCore 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 "menu.h" - -Menu::Menu(QGraphicsItem *parent) : QGraphicsWidget(parent), m_selected(0) -{ - setFlag(QGraphicsItem::ItemIsFocusable); - m_selection = new QGraphicsRectItem(this); - QLinearGradient linearGrad(QPointF(0, 0), QPointF(0,50)); - linearGrad.setColorAt(0, QColor(255,255,255,128)); - linearGrad.setColorAt(1, QColor(255,255,255,16)); - m_selection->setBrush(linearGrad); - m_selection->setPen(QPen(Qt::transparent)); -} - -Menu::~Menu() -{ -} - - -MenuAction *Menu::addAction(const QString &text, QObject *receiver, const char* slot) -{ - MenuAction *action = new MenuAction(text, this); - if (!m_actions.isEmpty()) { - MenuAction *last = m_actions.last(); - action->setPos(last->pos() + last->boundingRect().bottomLeft()); - } - m_actions.append(action); - if (m_selection->boundingRect().width() < action->boundingRect().width()) - m_selection->setRect(action->boundingRect()); - - QObject::connect(action, SIGNAL(triggered()), receiver, slot); - return action; -} - -QRectF Menu::boundingRect() const -{ - QRectF res; - foreach (MenuAction *a, m_actions) - res |= a->boundingRect(); - return res; -} - -void Menu::keyPressEvent (QKeyEvent * event) -{ - switch (event->key()) { - case Qt::Key_Escape: - hide(); - break; - case Qt::Key_Up: - m_selected -= 2; - case Qt::Key_Down: - if (!m_actions.isEmpty()) { - m_selected = (m_selected + 1 + m_actions.count()) % m_actions.count(); - QItemAnimation *anim = new QItemAnimation(m_selection, QItemAnimation::Position); - anim->setEndValue(m_actions.at(m_selected)->pos()); - anim->start(QAbstractAnimation::DeleteWhenStopped); - } - break; - case Qt::Key_Enter: - case Qt::Key_Return: - if (!m_actions.isEmpty()) { - QItemAnimation *anim = new QItemAnimation(m_selection, QItemAnimation::RotationX); - anim->setEndValue(m_selection->xRotation() < 180 ? qreal(360) : qreal(0)); - anim->start(QAbstractAnimation::DeleteWhenStopped); - m_actions.at(m_selected)->trigger(); - hide(); - } - break; - default: - QGraphicsItem::keyPressEvent(event); - } -} - -void Menu::show() -{ - QItemAnimation *anim = new QItemAnimation(this, QItemAnimation::Opacity); - anim->setEndValue(qreal(1.)); - anim->start(QAbstractAnimation::DeleteWhenStopped); - anim = new QItemAnimation(m_selection, QItemAnimation::ScaleFactorX); - anim->setEndValue(qreal(1)); - anim->start(QAbstractAnimation::DeleteWhenStopped); - anim = new QItemAnimation(m_selection, QItemAnimation::ScaleFactorY); - anim->setEndValue(qreal(1)); - anim->start(QAbstractAnimation::DeleteWhenStopped); - setFocus(); -} - -void Menu::hide() -{ - QItemAnimation *anim = new QItemAnimation(m_selection, QItemAnimation::ScaleFactorX); - anim->setEndValue(qreal(.1)); - anim->start(QAbstractAnimation::DeleteWhenStopped); - anim = new QItemAnimation(m_selection, QItemAnimation::ScaleFactorY); - anim->setEndValue(qreal(.1)); - anim->start(QAbstractAnimation::DeleteWhenStopped); - anim = new QItemAnimation(this, QItemAnimation::Opacity); - anim->setEndValue(qreal(0)); - anim->start(QAbstractAnimation::DeleteWhenStopped); - parentItem()->setFocus(); -} - - -MenuAction::MenuAction(const QString &text, Menu * parent) - : QGraphicsTextItem(text,parent) -{ - QFont f = font(); - f.setPointSize(18); - setFont(f); - setDefaultTextColor(Qt::white); -} - -void MenuAction::trigger() -{ - emit triggered(); -} diff --git a/examples/animation/photobrowser/menu.h b/examples/animation/photobrowser/menu.h deleted file mode 100644 index 3bdfe45..0000000 --- a/examples/animation/photobrowser/menu.h +++ /dev/null @@ -1,80 +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 QtCore 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 __MENU__H__ -#define __MENU__H__ - -#include - -class MenuAction; - -class Menu : public QGraphicsWidget -{ - Q_OBJECT -public: - Menu(QGraphicsItem *parent); - ~Menu(); - - MenuAction *addAction(const QString&, QObject *receiver = 0, const char* slot = 0 ); - - QRectF boundingRect() const; - void keyPressEvent ( QKeyEvent * event ); -public slots: - void show(); - void hide(); -private: - QList m_actions; - QGraphicsRectItem *m_selection; - int m_selected; -}; - -class MenuAction : public QGraphicsTextItem -{ - Q_OBJECT -public: - MenuAction(const QString &text, Menu * parent); - void trigger(); -signals: - void triggered(); -}; - - -#endif //__RIVERITEM__H__ diff --git a/examples/animation/photobrowser/photobrowser.pro b/examples/animation/photobrowser/photobrowser.pro deleted file mode 100644 index 21f03d6..0000000 --- a/examples/animation/photobrowser/photobrowser.pro +++ /dev/null @@ -1,17 +0,0 @@ -###################################################################### -# Automatically generated by qmake (2.01a) ven. 22. août 13:09:33 2008 -###################################################################### - -TEMPLATE = app -TARGET = -DEPENDPATH += . -INCLUDEPATH += . - -# Input -SOURCES += main.cpp \ - river.cpp \ - riveritem.cpp \ - menu.cpp -HEADERS += river.h \ - riveritem.h \ - menu.h diff --git a/examples/animation/photobrowser/river.cpp b/examples/animation/photobrowser/river.cpp deleted file mode 100644 index 6760066..0000000 --- a/examples/animation/photobrowser/river.cpp +++ /dev/null @@ -1,591 +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 QtCore 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 "river.h" -#include "riveritem.h" - -#include "qvariantanimation.h" - -#include -#include -#include -#include - - -#define GRID_ROW_COUNT 3 -#define GRID_COLUMN_COUNT 2 -#define GRID_DIMENSIONS (GRID_ROW_COUNT * GRID_COLUMN_COUNT) -#define ITEM_COUNT 12 - -#define RIVER_MAGNIFY(ITEM) (qreal(0.50) + (ITEM)->zValue()*2 ) -#define GRID_MAGNIFY qreal(1.5) -#define GRID_CURRENT_MAGNIFY 2 - -River::River(const QString &path) : -m_images(QDir(path).entryInfoList(QStringList() << QLatin1String("*.jpg") << QLatin1String("*.png"))), -m_currentImage(0), m_mode(RiverMode), m_selectedItem(-1) , m_topLeftIndex(-1) -{ - setFocusPolicy(Qt::StrongFocus); - setGeometry(QRectF( QPointF(), fixedSize())); - - - for (int i = 0; i < ITEM_COUNT; ++i) { - RiverItem * item = new RiverItem(this); - - //here we also randomize the x position (not when looping) - const int x = qrand() % fixedSize().width(); - item->setPos(x, -1); - - m_items.insert(m_currentImage, item); - addUnusedRiverItem(item); - } - -} - -QPointF River::gridItemPosition(int row, int col) const -{ - if (col < 0) { - col += GRID_COLUMN_COUNT; - row --; - } - return QPointF(rect().width()*(col*2 + 1)/(GRID_COLUMN_COUNT*2), - rect().height()*(row*2 + 1)/(GRID_ROW_COUNT*2)); -} - -QPixmap River::pixmap(int index) const -{ - if (index < 0 || index >= m_images.size()) - return QPixmap(); - - if (m_pixmaps.size() <= index) { - m_pixmaps.resize(index+1); - } - - if (m_pixmaps.at(index).isNull()) { - m_pixmaps[index] = QPixmap(m_images.at(index).absoluteFilePath()); - } - - return m_pixmaps.at(index); -} - -void River::addUnusedRiverItem(RiverItem * item) -{ - if (m_images.isEmpty()) - return; - - QRectF realItemRect = item->mapToParent(item->boundingRect()).boundingRect(); - - int y = item->pos().y(); - int x = item->pos().x(); - if (x >= fixedSize().width() || x < -realItemRect.width() || y < 0) { - //we set the new pixmap - - m_items.remove(m_items.key(item)); - - while (m_items.contains(m_currentImage)) - m_currentImage = (m_currentImage + 1 ) % m_images.size(); - - item->setPixmap(pixmap(m_currentImage)); - - m_items.insert(m_currentImage, item); - //this manages looping as well - m_currentImage = (m_currentImage + 1 ) % m_images.size(); - - item->setZValue(qreal(qrand()%100)/200.0); - - QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene()); - anim->setEndValue(RIVER_MAGNIFY(item)); - anim->start(QAbstractAnimation::DeleteWhenStopped); - anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene()); - anim->setEndValue(RIVER_MAGNIFY(item)); - anim->start(QAbstractAnimation::DeleteWhenStopped); - - realItemRect = item->mapToParent(item->boundingRect()).boundingRect(); - - y = -realItemRect.y() + qrand() % (fixedSize().height() - int(realItemRect.height())); - if (x >= fixedSize().width()) { - x = -realItemRect.width()/2; - } - } - - item->setPos(x, y); - - const QPointF target(QPointF(fixedSize().width() + realItemRect.width()/2, y)); - - const int distance = target.x() - x; - - const int duration = (40 - 50*item->zValue() ) * distance; - QItemAnimation *a = new QItemAnimation(item, QItemAnimation::Position, scene()); - a->setEndValue(target); - a->setDuration(duration); - a->start(QAbstractAnimation::DeleteWhenStopped); - connect(a, SIGNAL(finished()), SLOT(animationFinished())); -} - -void River::animationFinished() -{ - QItemAnimation *anim = qobject_cast(sender()); - if (!anim || anim->propertyName() != QItemAnimation::Position) - return; - - /*RiverItem *item = static_cast(anim->graphicsItem()); - if (m_mode != RiverMode) {*/ - /*int key = m_items.key(item); - if (key < m_topLeftIndex || key >= m_topLeftIndex + GRID_DIMENSIONS) { - delete item; - m_items.remove(key); - }*/ - //return; - - //} - - addUnusedRiverItem(static_cast(anim->targetItem())); -} - -void River::switchPaused() -{ - const bool paused = m_pausedAnimations.isEmpty(); - if (paused) - m_pausedAnimations = scene()->findChildren(); - - foreach(QItemAnimation *anim, m_pausedAnimations) { - if (paused) - anim->pause(); - else - anim->resume(); - } - - if (!paused) - m_pausedAnimations.clear(); -} - -void River::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *) -{ - painter->fillRect(option->rect, Qt::black); -} - -void River::setMode(Mode m) -{ - if (m_mode == m) - return; - - Mode oldMode = m_mode; - m_mode = m; - switch(m) - { - case RiverMode: - m_mode = oldMode; //some animation may be stopt, and we don't want that animationFinished we were in that mode yet - foreach (RiverItem *item, m_items) { - const int x = qrand() % fixedSize().width(); - const int y = qrand() % fixedSize().width(); - QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene()); - anim->setEndValue(RIVER_MAGNIFY(item)); - anim->start(QAbstractAnimation::DeleteWhenStopped); - anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene()); - anim->setEndValue(RIVER_MAGNIFY(item)); - anim->start(QAbstractAnimation::DeleteWhenStopped); - anim = new QItemAnimation(item, QItemAnimation::Position, scene()); - anim->setEndValue(QPointF(x, y)); - anim->start(QAbstractAnimation::DeleteWhenStopped); - connect(anim, SIGNAL(finished()), SLOT(animationFinished())); - } - m_mode = m; - break; - - case GridMode: - - if (oldMode == GridFullScreenMode) { - currentItem()->setFullScreen(false, GRID_CURRENT_MAGNIFY); - } else { - m_topLeftIndex = -GRID_DIMENSIONS; - foreach (RiverItem *item, m_items) { - QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene()); - anim->setEndValue(GRID_MAGNIFY); - anim->start(QAbstractAnimation::DeleteWhenStopped); - anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene()); - anim->setEndValue(GRID_MAGNIFY); - anim->start(QAbstractAnimation::DeleteWhenStopped); - } - adjustGrid(m_currentImage - GRID_DIMENSIONS + 1); - setCurrentItem(m_topLeftIndex); - } - break; - case GridFullScreenMode: - //let's put the current item fullscreen - currentItem()->setFullScreen(true, GRID_CURRENT_MAGNIFY); - break; - case CoverMode: - m_gridItem = m_items.values(); - setCurrentItem(m_gridItem.count()/2); - default: - break; - } -} - -River::Mode River::mode() const -{ - return m_mode; -} - -QSize River::fixedSize() -{ - return QSize(352, 416); -} - -//the name of this method is not that good... -void River::makeCenterAvailable(qreal size) -{ - QRectF center(QPointF(), QSizeF(size, size)); - center.moveCenter(rect().center()); - - const QList list = scene()->items(center); - - foreach(QGraphicsItem *item, m_items) { - - if (!list.contains(item)) - continue; - - QPointF pos = item->pos(); - - if (pos.y() < rect().center().y()) { - //item is above center - pos.ry() = center.top() - item->boundingRect().height() - 1; - } else { - //item is below the center - pos.ry() = center.bottom() + 1; - } - QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::Position, scene()); - anim->setEndValue(pos); - anim->setDuration(150); - anim->start(QAbstractAnimation::DeleteWhenStopped); - } -} - - -//this is there just to test small interaction -void River::keyPressEvent ( QKeyEvent * keyEvent ) -{ - switch(keyEvent->key()) - { - case Qt::Key_O: - { - QItemAnimation *anim = new QItemAnimation(this, QItemAnimation::Opacity, scene()); - anim->setDuration(2000); - anim->setEndValue(qreal(.5)); - anim->start(QAbstractAnimation::DeleteWhenStopped); - } - break; - case Qt::Key_N: - //that's a test - makeCenterAvailable(60); - break; - case Qt::Key_P: - switchPaused(); - break; - case Qt::Key_V: - setMode(GridMode); - break; - case Qt::Key_R: - setMode(RiverMode); - break; - case Qt::Key_C: - setMode(CoverMode); - break; - case Qt::Key_Return: - case Qt::Key_Enter: - if (m_mode == RiverMode) { - setMode(GridMode); - } else if (m_mode == GridMode) { - setMode(GridFullScreenMode); - } else if (m_mode == GridFullScreenMode) { - setMode(GridMode); - } - break; - case Qt::Key_Escape: - if (m_mode == GridFullScreenMode) { - setMode(GridMode); - } else if (m_mode == GridMode || m_mode == CoverMode) { - setMode(RiverMode); - } else if (m_mode == RiverMode) { - menu->show(); - } - break; - case Qt::Key_Right: - if (m_mode == GridMode) { - navigateBy(+1); - } else if (m_mode == CoverMode) { - setCurrentItem(m_selectedItem + 1); - } - break; - case Qt::Key_Left: - if (m_mode == GridMode) { - navigateBy(-1); - } else if (m_mode == CoverMode) { - setCurrentItem(m_selectedItem - 1); - } - break; - case Qt::Key_Down: - if (m_mode == GridMode) { - navigateBy(GRID_COLUMN_COUNT); - } - break; - case Qt::Key_Up: - if (m_mode == GridMode) { - navigateBy(-GRID_COLUMN_COUNT); - } - break; -// case Qt::Key_PageUp: - case Qt::Key_M: - menu->show(); - break; - case Qt::Key_Space: - if (m_mode == GridMode) { - RiverItem *item = currentItem(); - if(!item) - break; - - //stupid sequence. - QPointF pos = item->pos(); - QAnimationGroup *group = new QSequentialAnimationGroup(); - //item->animator()->beginSequence(); - - QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::Position, scene()); - anim->setEndValue(pos); - group->addAnimation(anim); - anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene()); - anim->setEndValue(qreal(1.)); - anim->setDuration(500); - group->addAnimation(anim); - anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene()); - anim->setEndValue(qreal(1.)); - anim->setDuration(500); - group->addAnimation(anim); - anim = new QItemAnimation(item, QItemAnimation::RotationX, scene()); - anim->setEndValue(qreal(0)); - group->addAnimation(anim); - group->start(QAbstractAnimation::DeleteWhenStopped); - } - default: - break; - } - - QGraphicsItem::keyPressEvent(keyEvent); -} - - -void River::setGridMode() -{ - setMode(GridMode); -} - -void River::setRiverMode() -{ - setMode(RiverMode); -} - -void River::setCoverMode() -{ - setMode(CoverMode); -} - - -void River::adjustGrid(int newTopLeft) -{ - for (int i = newTopLeft ; i < newTopLeft + GRID_DIMENSIONS; i++) { - if (!m_items.contains(i)) { - RiverItem *item = createItem(i); - int row = (i - m_topLeftIndex) / GRID_COLUMN_COUNT; - int col = (i - m_topLeftIndex) % GRID_COLUMN_COUNT; - item->setPos(gridItemPosition(row, col)); - item->setXScale(0); - item->setYScale(0); - QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene()); - anim->setEndValue(GRID_MAGNIFY); - anim->start(QAbstractAnimation::DeleteWhenStopped); - anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene()); - anim->setEndValue(GRID_MAGNIFY); - anim->start(QAbstractAnimation::DeleteWhenStopped); - } - } - newTopLeft = newTopLeft - newTopLeft % GRID_COLUMN_COUNT; - - QHash::iterator it = m_items.begin(); - while (it != m_items.constEnd()) { - const int imageIdx = it.key(); - RiverItem *item = *it; - QSizeF itemSize = item->boundingRect().size(); - if ((imageIdx >= newTopLeft && imageIdx < newTopLeft + GRID_DIMENSIONS) - || boundingRect().adjusted(-itemSize.width()/2, -itemSize.height()/2, itemSize.width()/2, itemSize.height()/2) - .contains(item->pos())) { - int row = (imageIdx-newTopLeft) / GRID_COLUMN_COUNT; - int col = (imageIdx-newTopLeft) % GRID_COLUMN_COUNT; - QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::Position, scene()); - anim->setEndValue(gridItemPosition(row, col)); - anim->start(QAbstractAnimation::DeleteWhenStopped); - ++it; - } else { - ++it; /* ### ideally we should remove the items, but this cause the photobrowser to crash - because the QItemAnimations are not notified the item is deleted - delete item; - it = m_items.erase(it); - */ - } - } - - m_topLeftIndex = newTopLeft; -} - - -RiverItem *River::createItem(int imageIndex) -{ - Q_ASSERT(!m_items.contains(imageIndex)); - RiverItem * item = new RiverItem(this); - item->setPixmap(pixmap(imageIndex)); - m_items.insert(imageIndex,item); - return item; -} - -void River::setCurrentItem(int newCurrentItem) -{ - if (m_mode == CoverMode) - { - m_selectedItem = newCurrentItem; - for (int i = 0; i < m_gridItem.count(); i++) { - QVariantAnimation *anim; - RiverItem *item = m_gridItem.at(i); - - qreal rotation = 0; - qreal width = boundingRect().width() / 2; - qreal x = width; - qreal scale = 3; - qreal z = 1; - qreal y = boundingRect().height()/2; - - if (i < newCurrentItem - 4) { - item->setVisible(false); - item->setPos(QPointF(0, y)); - continue; - } else if(i > newCurrentItem + 4) { - item->setVisible(false); - item->setPos(QPointF(boundingRect().width(), y)); - continue; - } else if (i < newCurrentItem) { - x = (i - newCurrentItem + 4) * width/7; - rotation = -75; - scale = 2; - z = 1.+qreal(i-newCurrentItem)/10.; - } else if (i > newCurrentItem) { - x = width + (i - newCurrentItem + 3) * width/7; - rotation = 75; - scale = 2; - z = 1.-qreal(i-newCurrentItem)/8.; - } - - item->setVisible(true); - item->setZValue(z); - - anim = new QItemAnimation(item, QItemAnimation::RotationY, scene()); - anim->setEndValue(rotation); - anim->start(QAbstractAnimation::DeleteWhenStopped); - - anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene()); - anim->setEndValue(scale); - anim->start(QVariantAnimation::DeleteWhenStopped); - - anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene()); - anim->setEndValue(scale); - anim->start(QVariantAnimation::DeleteWhenStopped); - - anim = new QItemAnimation(item, QItemAnimation::Position, scene()); - anim->setEndValue(QPointF(x,y)); - anim->start(QVariantAnimation::DeleteWhenStopped); - } - return; - } - - - //deselect the current item - if (m_selectedItem >= 0 && m_items.contains(m_selectedItem)) { - RiverItem *item = m_items.value(m_selectedItem); - item->setZValue(qreal(qrand()%100)/200.0); - QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene()); - anim->setEndValue(GRID_MAGNIFY); - anim->start(QAbstractAnimation::DeleteWhenStopped); - anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene()); - anim->setEndValue(GRID_MAGNIFY); - anim->start(QAbstractAnimation::DeleteWhenStopped); - } - - if (newCurrentItem < 0) { - m_selectedItem = newCurrentItem; - return; - } - - //ensure visible; - if (newCurrentItem < m_topLeftIndex) { - adjustGrid(newCurrentItem); - } else if (newCurrentItem >= m_topLeftIndex + GRID_DIMENSIONS) { - adjustGrid(newCurrentItem - GRID_DIMENSIONS + GRID_COLUMN_COUNT); - } - - //select the new one - m_selectedItem = newCurrentItem; - RiverItem *item = currentItem(); - Q_ASSERT(item); - item->setZValue(1); - - QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene()); - anim->setEndValue(GRID_CURRENT_MAGNIFY); - anim->start(QAbstractAnimation::DeleteWhenStopped); - anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene()); - anim->setEndValue(GRID_CURRENT_MAGNIFY); - anim->start(QAbstractAnimation::DeleteWhenStopped); -} - -void River::navigateBy(int offset) -{ - int newSelection = m_selectedItem + offset; - const int imageCount = m_images.size(); - while (newSelection < 0) - newSelection += imageCount; - newSelection %= imageCount; - setCurrentItem(newSelection); -} diff --git a/examples/animation/photobrowser/river.h b/examples/animation/photobrowser/river.h deleted file mode 100644 index d6bfc76..0000000 --- a/examples/animation/photobrowser/river.h +++ /dev/null @@ -1,111 +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 QtCore 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 __RIVER__H__ -#define __RIVER__H__ - -#include -#include - -#include "menu.h" - -class RiverItem; - -class River : public QGraphicsWidget -{ - Q_OBJECT -public: - enum Mode - { - RiverMode, - GridMode, - GridFullScreenMode, - CoverMode - }; - - River(const QString &path); - void addUnusedRiverItem(RiverItem * item); - - static QSize fixedSize(); - - void switchPaused(); - - void setMode(Mode m); - Mode mode() const; - - Menu *menu; - -protected: - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); - void keyPressEvent ( QKeyEvent * keyEvent ); - void makeCenterAvailable(qreal size); - QPointF gridItemPosition(int row, int col) const; - QPixmap pixmap(int index) const; - -protected slots: - void animationFinished(); -public slots: - void setRiverMode(); - void setGridMode(); - void setCoverMode(); - -private: - const QFileInfoList m_images; - int m_currentImage; - mutable QVector m_pixmaps; - QHash m_items; - QList m_gridItem; - QList m_pausedAnimations; - Mode m_mode; - - void adjustGrid(int topRight); - RiverItem *currentItem() { return m_items.value(m_selectedItem); } - RiverItem *createItem(int imageIndex); - void setCurrentItem(int currentItem); - void navigateBy(int offset); - - int m_selectedItem; - int m_topLeftIndex; - -}; - - -#endif //__RIVERITEM__H__ diff --git a/examples/animation/photobrowser/riveritem.cpp b/examples/animation/photobrowser/riveritem.cpp deleted file mode 100644 index 9692d30..0000000 --- a/examples/animation/photobrowser/riveritem.cpp +++ /dev/null @@ -1,125 +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 QtCore 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 "riveritem.h" -#include "river.h" - -RiverItem::RiverItem(QGraphicsItem *parent) : QGraphicsPixmapItem(parent), m_fullscreen(false) -{ - setCacheMode(DeviceCoordinateCache); -} - -RiverItem::~RiverItem() -{ -} - -void RiverItem::setPixmap(const QPixmap &pix) -{ - const QSize oldSize = pixmap().size(); - const QSize newSize = pix.size(); - QGraphicsPixmapItem::setPixmap(pix); - - if (newSize != oldSize) { - setOffset(-newSize.width()/2, -newSize.height()/2); - const qreal scaleFactor = qreal(River::fixedSize().height())/(qreal(pix.height()*7)); - setTransform(QTransform().scale(scaleFactor, scaleFactor)); - prepareGeometryChange(); - } -} - - -void RiverItem::setFullScreen(bool b, qreal originScaleFactor) -{ - if (m_fullscreen == b) - return; - - m_fullscreen = b; - - QPointF newPos; - qreal rotationZ; - qreal scaleX, scaleY; - - if (b) { - const QSizeF basePixmapSize = transform().map(boundingRect()).boundingRect().size(); - - newPos = parentItem()->boundingRect().center(); - rotationZ = 90; - scaleY = qreal(River::fixedSize().width()) / basePixmapSize.height() * yScale(); - scaleX = qreal(River::fixedSize().height()) / basePixmapSize.width() * xScale(); - - if (m_nonFSPos.isNull()) { - m_nonFSPos = pos(); //let's save our current (non fullscreen) position - } - - } else { - Q_ASSERT(!m_nonFSPos.isNull()); - rotationZ = 0; - scaleX = originScaleFactor; - scaleY = originScaleFactor; - newPos = m_nonFSPos; - } - - QAnimationGroup *group = new QParallelAnimationGroup(scene()); - QItemAnimation *anim = new QItemAnimation(this, QItemAnimation::Position); - anim->setEndValue(newPos); - group->addAnimation(anim); - anim = new QItemAnimation(this, QItemAnimation::RotationZ); - anim->setEndValue(rotationZ); - group->addAnimation(anim); - anim = new QItemAnimation(this, QItemAnimation::ScaleFactorX); - anim->setEndValue(scaleX); - group->addAnimation(anim); - anim = new QItemAnimation(this, QItemAnimation::ScaleFactorY); - anim->setEndValue(scaleY); - group->addAnimation(anim); - group->start(QAbstractAnimation::DeleteWhenStopped); -} - -void RiverItem::mousePressEvent(QGraphicsSceneMouseEvent*) -{ - //just let it rotate on itself - QItemAnimation *anim = new QItemAnimation(this, QItemAnimation::RotationY); - anim->setEndValue(yRotation() < 180 ? 360 : 0); - anim->setDuration(500); - anim->start(QAbstractAnimation::DeleteWhenStopped); -} - - diff --git a/examples/animation/photobrowser/riveritem.h b/examples/animation/photobrowser/riveritem.h deleted file mode 100644 index 2023c44..0000000 --- a/examples/animation/photobrowser/riveritem.h +++ /dev/null @@ -1,66 +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 QtCore 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 __RIVERITEM__H__ -#define __RIVERITEM__H__ - -#include - -class RiverItemAnimator; - -class RiverItem : public QGraphicsPixmapItem -{ -public: - RiverItem(QGraphicsItem *parent); - ~RiverItem(); - - void setPixmap(const QPixmap &); - void setFullScreen(bool b, qreal originScaleFactor); - -protected: - void mousePressEvent(QGraphicsSceneMouseEvent*); - -private: - QPointF m_nonFSPos; //to save the position when not in fullscreen - bool m_fullscreen; -}; - -#endif //__RIVERITEM__H__ diff --git a/examples/animation/piemenu/main.cpp b/examples/animation/piemenu/main.cpp deleted file mode 100644 index 8076da8..0000000 --- a/examples/animation/piemenu/main.cpp +++ /dev/null @@ -1,56 +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 QtCore 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 -#include "scene.h" -#include "qgraphicspiemenu.h" - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - Scene scene; - - QGraphicsView view(&scene); - view.show(); - - return app.exec(); -} diff --git a/examples/animation/piemenu/piemenu.pro b/examples/animation/piemenu/piemenu.pro deleted file mode 100644 index 4d7a067..0000000 --- a/examples/animation/piemenu/piemenu.pro +++ /dev/null @@ -1,8 +0,0 @@ -SOURCES += \ - main.cpp \ - qgraphicspiemenu.cpp \ - scene.cpp -HEADERS += \ - qgraphicspiemenu.h \ - qgraphicspiemenu_p.h \ - scene.h diff --git a/examples/animation/piemenu/qgraphicspiemenu.cpp b/examples/animation/piemenu/qgraphicspiemenu.cpp deleted file mode 100644 index a199119..0000000 --- a/examples/animation/piemenu/qgraphicspiemenu.cpp +++ /dev/null @@ -1,250 +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 QtCore 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 "qgraphicspiemenu.h" -#include "qgraphicspiemenu_p.h" - -#include - -QGraphicsPieMenu::QGraphicsPieMenu(QGraphicsItem *parent) - : QGraphicsWidget(parent), d_ptr(new QGraphicsPieMenuPrivate) -{ - d_ptr->q_ptr = this; - d_ptr->machine = new QStateMachine(); - d_ptr->popupState = new QState(d_ptr->machine->rootState()); - d_ptr->machine->setInitialState(d_ptr->popupState); - d_ptr->menuAction = new QAction(this); -} - -QGraphicsPieMenu::QGraphicsPieMenu(const QString &title, QGraphicsItem *parent) - : QGraphicsWidget(parent), d_ptr(new QGraphicsPieMenuPrivate) -{ - d_ptr->q_ptr = this; - d_ptr->machine = new QStateMachine(); - d_ptr->popupState = new QState(d_ptr->machine->rootState()); - d_ptr->machine->setInitialState(d_ptr->popupState); - d_ptr->menuAction = new QAction(this); - setTitle(title); -} - -QGraphicsPieMenu::QGraphicsPieMenu(const QIcon &icon, const QString &title, QGraphicsItem *parent) - : QGraphicsWidget(parent), d_ptr(new QGraphicsPieMenuPrivate) -{ - d_ptr->q_ptr = this; - d_ptr->machine = new QStateMachine(); - d_ptr->popupState = new QState(d_ptr->machine->rootState()); - d_ptr->machine->setInitialState(d_ptr->popupState); - d_ptr->menuAction = new QAction(this); - setIcon(icon); - setTitle(title); -} - -QGraphicsPieMenu::~QGraphicsPieMenu() -{ - delete d_ptr; -} - -QAction *QGraphicsPieMenu::addAction(const QString &text) -{ - QAction *action = new QAction(text, this); - addAction(action); - return action; -} - -QAction *QGraphicsPieMenu::addAction(const QIcon &icon, const QString &text) -{ - QAction *action = new QAction(icon, text, this); - addAction(action); - return action; -} - -QAction *QGraphicsPieMenu::addAction(const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut) -{ - QAction *action = new QAction(text, this); - action->setShortcut(shortcut); - connect(action, SIGNAL(triggered(bool)), receiver, member); - addAction(action); - return action; -} - -QAction *QGraphicsPieMenu::addAction(const QIcon &icon, const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut) -{ - QAction *action = new QAction(icon, text, this); - action->setShortcut(shortcut); - connect(action, SIGNAL(triggered(bool)), receiver, member); - addAction(action); - return action; -} - -QAction *QGraphicsPieMenu::addMenu(QGraphicsPieMenu *menu) -{ - QAction *action = menu->menuAction(); - addAction(action); - return action; -} - -QGraphicsPieMenu *QGraphicsPieMenu::addMenu(const QString &title) -{ - QGraphicsPieMenu *menu = new QGraphicsPieMenu(title, this); - addMenu(menu); - return menu; -} - -QGraphicsPieMenu *QGraphicsPieMenu::addMenu(const QIcon &icon, const QString &title) -{ - QGraphicsPieMenu *menu = new QGraphicsPieMenu(icon, title, this); - addMenu(menu); - return menu; -} - -QAction *QGraphicsPieMenu::addSeparator() -{ - QAction *action = new QAction(this); - action->setSeparator(true); - addAction(action); - return action; -} - -QAction *QGraphicsPieMenu::insertMenu(QAction *before, QGraphicsPieMenu *menu) -{ - QAction *action = menu->menuAction(); - insertAction(before, action); - return action; -} - -QAction *QGraphicsPieMenu::insertSeparator(QAction *before) -{ - QAction *action = new QAction(this); - action->setSeparator(true); - insertAction(before, action); - return action; -} - -QAction *QGraphicsPieMenu::menuAction() const -{ - return d_func()->menuAction; -} - -bool QGraphicsPieMenu::isEmpty() const -{ - // ### d->actions - QList actionList = actions(); - bool ret = true; - for (int i = 0; ret && i < actionList.size(); ++i) { - const QAction *action = actionList.at(i); - if (!action->isSeparator() && action->isVisible()) { - ret = false; - break; - } - } - return ret; -} - -void QGraphicsPieMenu::clear() -{ - // ### d->actions - QList actionList = actions(); - for(int i = 0; i < actionList.size(); i++) { - QAction *action = actionList.at(i); - removeAction(action); - if (action->parent() == this && action->associatedGraphicsWidgets().isEmpty()) - delete action; - } -} - -void QGraphicsPieMenu::popup(const QPointF &pos) -{ - Q_UNUSED(pos); - Q_D(QGraphicsPieMenu); - d->machine->start(); -} - -QAction *QGraphicsPieMenu::exec() -{ - return exec(pos()); -} - -QAction *QGraphicsPieMenu::exec(const QPointF &pos) -{ - Q_UNUSED(pos); - return 0; -} - -QAction *QGraphicsPieMenu::exec(QList actions, const QPointF &pos) -{ - QGraphicsPieMenu menu; - for (QList::ConstIterator it = actions.constBegin(); it != actions.constEnd(); ++it) - menu.addAction(*it); - return menu.exec(pos); -} - -QString QGraphicsPieMenu::title() const -{ - Q_D(const QGraphicsPieMenu); - return d->title; -} - -void QGraphicsPieMenu::setTitle(const QString &title) -{ - Q_D(QGraphicsPieMenu); - d->title = title; - updateGeometry(); -} - -QIcon QGraphicsPieMenu::icon() const -{ - Q_D(const QGraphicsPieMenu); - return d->icon; -} - -void QGraphicsPieMenu::setIcon(const QIcon &icon) -{ - Q_D(QGraphicsPieMenu); - d->icon = icon; - updateGeometry(); -} - -QSizeF QGraphicsPieMenu::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const -{ - Q_UNUSED(which); - Q_UNUSED(constraint); - return QSizeF(1, 1); -} diff --git a/examples/animation/piemenu/qgraphicspiemenu.h b/examples/animation/piemenu/qgraphicspiemenu.h deleted file mode 100644 index d784f93..0000000 --- a/examples/animation/piemenu/qgraphicspiemenu.h +++ /dev/null @@ -1,104 +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 QtCore 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 QGRAPHICSPIEMENU_H -#define QGRAPHICSPIEMENU_H - -#include - -class QGraphicsPieMenuPrivate; -class QGraphicsPieMenu : public QGraphicsWidget -{ - Q_OBJECT -public: - QGraphicsPieMenu(QGraphicsItem *parent = 0); - QGraphicsPieMenu(const QString &title, QGraphicsItem *parent = 0); - QGraphicsPieMenu(const QIcon &icon, const QString &title, QGraphicsItem *parent = 0); - ~QGraphicsPieMenu(); - -#ifdef Q_NO_USING_KEYWORD - inline void addAction(QAction *action) { QGraphicsWidget::addAction(action); } -#else - using QGraphicsWidget::addAction; -#endif - QAction *addAction(const QString &text); - QAction *addAction(const QIcon &icon, const QString &text); - QAction *addAction(const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut = 0); - QAction *addAction(const QIcon &icon, const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut = 0); - QAction *addMenu(QGraphicsPieMenu *menu); - QGraphicsPieMenu *addMenu(const QString &title); - QGraphicsPieMenu *addMenu(const QIcon &icon, const QString &title); - QAction *addSeparator(); - QAction *insertMenu(QAction *before, QGraphicsPieMenu *menu); - QAction *insertSeparator(QAction *before); - - QAction *menuAction() const; - - bool isEmpty() const; - void clear(); - - void popup(const QPointF &pos); - QAction *exec(); - QAction *exec(const QPointF &pos); - static QAction *exec(QList actions, const QPointF &pos); - - QString title() const; - void setTitle(const QString &title); - - QIcon icon() const; - void setIcon(const QIcon &icon); - -Q_SIGNALS: - void aboutToShow(); - void aboutToHide(); - void triggered(QAction *action); - void hovered(QAction *action); - -protected: - QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; - -private: - Q_DISABLE_COPY(QGraphicsPieMenu) - Q_DECLARE_PRIVATE(QGraphicsPieMenu) - QGraphicsPieMenuPrivate *d_ptr; -}; - -#endif diff --git a/examples/animation/piemenu/qgraphicspiemenu_p.h b/examples/animation/piemenu/qgraphicspiemenu_p.h deleted file mode 100644 index 458b8f1..0000000 --- a/examples/animation/piemenu/qgraphicspiemenu_p.h +++ /dev/null @@ -1,78 +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 QtCore 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 QGRAPHICSPIEMENU_P_H -#define QGRAPHICSPIEMENU_P_H - -#include "qgraphicspiemenu.h" -#include "qgraphicspiemenusection_p.h" - -#include -#include -#include -#include - -class QAction; -class QEventLoop; -class QGraphicsPieMenuSection; - -class QGraphicsPieMenuPrivate -{ - Q_DECLARE_PUBLIC(QGraphicsPieMenu); -public: - void init(const QIcon &icon = QIcon(), const QString &title = QString()); - - QIcon icon; - QString title; - QStateMachine *machine; - QState *popupState; - //QTransition *transition; - QList sections; - - QEventLoop *eventLoop; - - QAction *menuAction; - QGraphicsPieMenu *q_ptr; - - void updatePopupState(); -}; - -#endif diff --git a/examples/animation/piemenu/qgraphicspiemenusection_p.h b/examples/animation/piemenu/qgraphicspiemenusection_p.h deleted file mode 100644 index 2d71a06..0000000 --- a/examples/animation/piemenu/qgraphicspiemenusection_p.h +++ /dev/null @@ -1,88 +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 QtCore 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 QGRAPHICSPIEMENUSECTION_H -#define QGRAPHICSPIEMENUSECTION_H - -#include -#include - -class QGraphicsPieMenuSection : public QGraphicsWidget -{ - Q_OBJECT - Q_PROPERTY(qreal rotation READ rotation WRITE setRotation) -public: - QGraphicsPieMenuSection(QGraphicsItem *parent = 0) - : QGraphicsWidget(parent), rot(0) - { } - - qreal rotation() const - { - return rot; - } - void setRotation(qreal rotation) - { - rot = rotation; - setTransform(QTransform().rotate(rot)); - } - - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) - { - Q_UNUSED(option); - Q_UNUSED(widget); - painter->setPen(QPen(Qt::black, 1)); - painter->setBrush(QBrush(Qt::gray)); - painter->drawPie(QRectF(-100, -100, 200, 200), 0, -30 * 16); - } - -protected: - QSizeF sizeHint(Qt::SizeHint which, const QSizeF &size = QSizeF()) const - { - Q_UNUSED(which); - Q_UNUSED(size); - return QSizeF(100, 30); - } - -private: - qreal rot; -}; - -#endif diff --git a/examples/animation/piemenu/scene.cpp b/examples/animation/piemenu/scene.cpp deleted file mode 100644 index 6309975..0000000 --- a/examples/animation/piemenu/scene.cpp +++ /dev/null @@ -1,73 +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 QtCore 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 "qgraphicspiemenu.h" -#include "scene.h" - -#include -#include - -Scene::Scene(qreal x, qreal y, qreal width, qreal height, QObject *parent) - : QGraphicsScene(x, y, width, height, parent) -{ -} - -Scene::Scene(const QRectF &sceneRect, QObject *parent) - : QGraphicsScene(sceneRect, parent) -{ -} - -Scene::Scene(QObject *parent) - : QGraphicsScene(parent) -{ -} - -Scene::~Scene() -{ -} - -void Scene::mousePressEvent(QGraphicsSceneMouseEvent *event) -{ - QGraphicsPieMenu *menu = new QGraphicsPieMenu; - for (int i = 0; i < 5; ++i) - menu->addAction(new QAction(QString("Item %1").arg(i), menu)); - menu->popup(event->scenePos()); -} diff --git a/examples/animation/piemenu/scene.h b/examples/animation/piemenu/scene.h deleted file mode 100644 index bbfe6d3..0000000 --- a/examples/animation/piemenu/scene.h +++ /dev/null @@ -1,60 +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 QtCore 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 SCENE_H -#define SCENE_H - -#include - -class Scene : public QGraphicsScene -{ - Q_OBJECT -public: - Scene(qreal x, qreal y, qreal width, qreal height, QObject *parent = 0); - Scene(const QRectF &sceneRect, QObject *parent = 0); - Scene(QObject *parent = 0); - ~Scene(); - -protected: - void mousePressEvent(QGraphicsSceneMouseEvent *event); -}; - -#endif diff --git a/examples/animation/research/photobrowser/main.cpp b/examples/animation/research/photobrowser/main.cpp new file mode 100644 index 0000000..d5ab2a3 --- /dev/null +++ b/examples/animation/research/photobrowser/main.cpp @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 + +#include "river.h" +#include "menu.h" + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + if (app.arguments().size() == 1) { + qWarning("you have to specifiy a path to look for the photos"); + return 0; + } + + + QGraphicsScene scene; + scene.setSceneRect(QRectF(QPointF(), River::fixedSize())); + + QGraphicsView view(&scene); + view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + + const int fw = view.frameWidth() * 2; + view.setFixedSize(River::fixedSize() + QSize(fw,fw)); + + River river(app.arguments()[1]); + scene.addItem(&river); + + Menu menu(&river); + menu.addAction(QLatin1String("River Mode"), &river, SLOT(setRiverMode())); + menu.addAction(QLatin1String("Grid Mode"), &river, SLOT(setGridMode())); + menu.addAction(QLatin1String("Cover Flow"), &river, SLOT(setCoverMode())); + menu.addAction(QLatin1String("Hide Menu"), &menu, SLOT(hide())); + menu.addAction(QLatin1String("Exit"), &app, SLOT(quit())); + menu.setZValue(2); + menu.setFocus(); + + river.menu = &menu; + view.show(); + + return app.exec(); +} diff --git a/examples/animation/research/photobrowser/menu.cpp b/examples/animation/research/photobrowser/menu.cpp new file mode 100644 index 0000000..97493ba --- /dev/null +++ b/examples/animation/research/photobrowser/menu.cpp @@ -0,0 +1,155 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 "menu.h" + +Menu::Menu(QGraphicsItem *parent) : QGraphicsWidget(parent), m_selected(0) +{ + setFlag(QGraphicsItem::ItemIsFocusable); + m_selection = new QGraphicsRectItem(this); + QLinearGradient linearGrad(QPointF(0, 0), QPointF(0,50)); + linearGrad.setColorAt(0, QColor(255,255,255,128)); + linearGrad.setColorAt(1, QColor(255,255,255,16)); + m_selection->setBrush(linearGrad); + m_selection->setPen(QPen(Qt::transparent)); +} + +Menu::~Menu() +{ +} + + +MenuAction *Menu::addAction(const QString &text, QObject *receiver, const char* slot) +{ + MenuAction *action = new MenuAction(text, this); + if (!m_actions.isEmpty()) { + MenuAction *last = m_actions.last(); + action->setPos(last->pos() + last->boundingRect().bottomLeft()); + } + m_actions.append(action); + if (m_selection->boundingRect().width() < action->boundingRect().width()) + m_selection->setRect(action->boundingRect()); + + QObject::connect(action, SIGNAL(triggered()), receiver, slot); + return action; +} + +QRectF Menu::boundingRect() const +{ + QRectF res; + foreach (MenuAction *a, m_actions) + res |= a->boundingRect(); + return res; +} + +void Menu::keyPressEvent (QKeyEvent * event) +{ + switch (event->key()) { + case Qt::Key_Escape: + hide(); + break; + case Qt::Key_Up: + m_selected -= 2; + case Qt::Key_Down: + if (!m_actions.isEmpty()) { + m_selected = (m_selected + 1 + m_actions.count()) % m_actions.count(); + QItemAnimation *anim = new QItemAnimation(m_selection, QItemAnimation::Position); + anim->setEndValue(m_actions.at(m_selected)->pos()); + anim->start(QAbstractAnimation::DeleteWhenStopped); + } + break; + case Qt::Key_Enter: + case Qt::Key_Return: + if (!m_actions.isEmpty()) { + QItemAnimation *anim = new QItemAnimation(m_selection, QItemAnimation::RotationX); + anim->setEndValue(m_selection->xRotation() < 180 ? qreal(360) : qreal(0)); + anim->start(QAbstractAnimation::DeleteWhenStopped); + m_actions.at(m_selected)->trigger(); + hide(); + } + break; + default: + QGraphicsItem::keyPressEvent(event); + } +} + +void Menu::show() +{ + QItemAnimation *anim = new QItemAnimation(this, QItemAnimation::Opacity); + anim->setEndValue(qreal(1.)); + anim->start(QAbstractAnimation::DeleteWhenStopped); + anim = new QItemAnimation(m_selection, QItemAnimation::ScaleFactorX); + anim->setEndValue(qreal(1)); + anim->start(QAbstractAnimation::DeleteWhenStopped); + anim = new QItemAnimation(m_selection, QItemAnimation::ScaleFactorY); + anim->setEndValue(qreal(1)); + anim->start(QAbstractAnimation::DeleteWhenStopped); + setFocus(); +} + +void Menu::hide() +{ + QItemAnimation *anim = new QItemAnimation(m_selection, QItemAnimation::ScaleFactorX); + anim->setEndValue(qreal(.1)); + anim->start(QAbstractAnimation::DeleteWhenStopped); + anim = new QItemAnimation(m_selection, QItemAnimation::ScaleFactorY); + anim->setEndValue(qreal(.1)); + anim->start(QAbstractAnimation::DeleteWhenStopped); + anim = new QItemAnimation(this, QItemAnimation::Opacity); + anim->setEndValue(qreal(0)); + anim->start(QAbstractAnimation::DeleteWhenStopped); + parentItem()->setFocus(); +} + + +MenuAction::MenuAction(const QString &text, Menu * parent) + : QGraphicsTextItem(text,parent) +{ + QFont f = font(); + f.setPointSize(18); + setFont(f); + setDefaultTextColor(Qt::white); +} + +void MenuAction::trigger() +{ + emit triggered(); +} diff --git a/examples/animation/research/photobrowser/menu.h b/examples/animation/research/photobrowser/menu.h new file mode 100644 index 0000000..3bdfe45 --- /dev/null +++ b/examples/animation/research/photobrowser/menu.h @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 __MENU__H__ +#define __MENU__H__ + +#include + +class MenuAction; + +class Menu : public QGraphicsWidget +{ + Q_OBJECT +public: + Menu(QGraphicsItem *parent); + ~Menu(); + + MenuAction *addAction(const QString&, QObject *receiver = 0, const char* slot = 0 ); + + QRectF boundingRect() const; + void keyPressEvent ( QKeyEvent * event ); +public slots: + void show(); + void hide(); +private: + QList m_actions; + QGraphicsRectItem *m_selection; + int m_selected; +}; + +class MenuAction : public QGraphicsTextItem +{ + Q_OBJECT +public: + MenuAction(const QString &text, Menu * parent); + void trigger(); +signals: + void triggered(); +}; + + +#endif //__RIVERITEM__H__ diff --git a/examples/animation/research/photobrowser/photobrowser.pro b/examples/animation/research/photobrowser/photobrowser.pro new file mode 100644 index 0000000..21f03d6 --- /dev/null +++ b/examples/animation/research/photobrowser/photobrowser.pro @@ -0,0 +1,17 @@ +###################################################################### +# Automatically generated by qmake (2.01a) ven. 22. août 13:09:33 2008 +###################################################################### + +TEMPLATE = app +TARGET = +DEPENDPATH += . +INCLUDEPATH += . + +# Input +SOURCES += main.cpp \ + river.cpp \ + riveritem.cpp \ + menu.cpp +HEADERS += river.h \ + riveritem.h \ + menu.h diff --git a/examples/animation/research/photobrowser/river.cpp b/examples/animation/research/photobrowser/river.cpp new file mode 100644 index 0000000..6760066 --- /dev/null +++ b/examples/animation/research/photobrowser/river.cpp @@ -0,0 +1,591 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 "river.h" +#include "riveritem.h" + +#include "qvariantanimation.h" + +#include +#include +#include +#include + + +#define GRID_ROW_COUNT 3 +#define GRID_COLUMN_COUNT 2 +#define GRID_DIMENSIONS (GRID_ROW_COUNT * GRID_COLUMN_COUNT) +#define ITEM_COUNT 12 + +#define RIVER_MAGNIFY(ITEM) (qreal(0.50) + (ITEM)->zValue()*2 ) +#define GRID_MAGNIFY qreal(1.5) +#define GRID_CURRENT_MAGNIFY 2 + +River::River(const QString &path) : +m_images(QDir(path).entryInfoList(QStringList() << QLatin1String("*.jpg") << QLatin1String("*.png"))), +m_currentImage(0), m_mode(RiverMode), m_selectedItem(-1) , m_topLeftIndex(-1) +{ + setFocusPolicy(Qt::StrongFocus); + setGeometry(QRectF( QPointF(), fixedSize())); + + + for (int i = 0; i < ITEM_COUNT; ++i) { + RiverItem * item = new RiverItem(this); + + //here we also randomize the x position (not when looping) + const int x = qrand() % fixedSize().width(); + item->setPos(x, -1); + + m_items.insert(m_currentImage, item); + addUnusedRiverItem(item); + } + +} + +QPointF River::gridItemPosition(int row, int col) const +{ + if (col < 0) { + col += GRID_COLUMN_COUNT; + row --; + } + return QPointF(rect().width()*(col*2 + 1)/(GRID_COLUMN_COUNT*2), + rect().height()*(row*2 + 1)/(GRID_ROW_COUNT*2)); +} + +QPixmap River::pixmap(int index) const +{ + if (index < 0 || index >= m_images.size()) + return QPixmap(); + + if (m_pixmaps.size() <= index) { + m_pixmaps.resize(index+1); + } + + if (m_pixmaps.at(index).isNull()) { + m_pixmaps[index] = QPixmap(m_images.at(index).absoluteFilePath()); + } + + return m_pixmaps.at(index); +} + +void River::addUnusedRiverItem(RiverItem * item) +{ + if (m_images.isEmpty()) + return; + + QRectF realItemRect = item->mapToParent(item->boundingRect()).boundingRect(); + + int y = item->pos().y(); + int x = item->pos().x(); + if (x >= fixedSize().width() || x < -realItemRect.width() || y < 0) { + //we set the new pixmap + + m_items.remove(m_items.key(item)); + + while (m_items.contains(m_currentImage)) + m_currentImage = (m_currentImage + 1 ) % m_images.size(); + + item->setPixmap(pixmap(m_currentImage)); + + m_items.insert(m_currentImage, item); + //this manages looping as well + m_currentImage = (m_currentImage + 1 ) % m_images.size(); + + item->setZValue(qreal(qrand()%100)/200.0); + + QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene()); + anim->setEndValue(RIVER_MAGNIFY(item)); + anim->start(QAbstractAnimation::DeleteWhenStopped); + anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene()); + anim->setEndValue(RIVER_MAGNIFY(item)); + anim->start(QAbstractAnimation::DeleteWhenStopped); + + realItemRect = item->mapToParent(item->boundingRect()).boundingRect(); + + y = -realItemRect.y() + qrand() % (fixedSize().height() - int(realItemRect.height())); + if (x >= fixedSize().width()) { + x = -realItemRect.width()/2; + } + } + + item->setPos(x, y); + + const QPointF target(QPointF(fixedSize().width() + realItemRect.width()/2, y)); + + const int distance = target.x() - x; + + const int duration = (40 - 50*item->zValue() ) * distance; + QItemAnimation *a = new QItemAnimation(item, QItemAnimation::Position, scene()); + a->setEndValue(target); + a->setDuration(duration); + a->start(QAbstractAnimation::DeleteWhenStopped); + connect(a, SIGNAL(finished()), SLOT(animationFinished())); +} + +void River::animationFinished() +{ + QItemAnimation *anim = qobject_cast(sender()); + if (!anim || anim->propertyName() != QItemAnimation::Position) + return; + + /*RiverItem *item = static_cast(anim->graphicsItem()); + if (m_mode != RiverMode) {*/ + /*int key = m_items.key(item); + if (key < m_topLeftIndex || key >= m_topLeftIndex + GRID_DIMENSIONS) { + delete item; + m_items.remove(key); + }*/ + //return; + + //} + + addUnusedRiverItem(static_cast(anim->targetItem())); +} + +void River::switchPaused() +{ + const bool paused = m_pausedAnimations.isEmpty(); + if (paused) + m_pausedAnimations = scene()->findChildren(); + + foreach(QItemAnimation *anim, m_pausedAnimations) { + if (paused) + anim->pause(); + else + anim->resume(); + } + + if (!paused) + m_pausedAnimations.clear(); +} + +void River::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *) +{ + painter->fillRect(option->rect, Qt::black); +} + +void River::setMode(Mode m) +{ + if (m_mode == m) + return; + + Mode oldMode = m_mode; + m_mode = m; + switch(m) + { + case RiverMode: + m_mode = oldMode; //some animation may be stopt, and we don't want that animationFinished we were in that mode yet + foreach (RiverItem *item, m_items) { + const int x = qrand() % fixedSize().width(); + const int y = qrand() % fixedSize().width(); + QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene()); + anim->setEndValue(RIVER_MAGNIFY(item)); + anim->start(QAbstractAnimation::DeleteWhenStopped); + anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene()); + anim->setEndValue(RIVER_MAGNIFY(item)); + anim->start(QAbstractAnimation::DeleteWhenStopped); + anim = new QItemAnimation(item, QItemAnimation::Position, scene()); + anim->setEndValue(QPointF(x, y)); + anim->start(QAbstractAnimation::DeleteWhenStopped); + connect(anim, SIGNAL(finished()), SLOT(animationFinished())); + } + m_mode = m; + break; + + case GridMode: + + if (oldMode == GridFullScreenMode) { + currentItem()->setFullScreen(false, GRID_CURRENT_MAGNIFY); + } else { + m_topLeftIndex = -GRID_DIMENSIONS; + foreach (RiverItem *item, m_items) { + QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene()); + anim->setEndValue(GRID_MAGNIFY); + anim->start(QAbstractAnimation::DeleteWhenStopped); + anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene()); + anim->setEndValue(GRID_MAGNIFY); + anim->start(QAbstractAnimation::DeleteWhenStopped); + } + adjustGrid(m_currentImage - GRID_DIMENSIONS + 1); + setCurrentItem(m_topLeftIndex); + } + break; + case GridFullScreenMode: + //let's put the current item fullscreen + currentItem()->setFullScreen(true, GRID_CURRENT_MAGNIFY); + break; + case CoverMode: + m_gridItem = m_items.values(); + setCurrentItem(m_gridItem.count()/2); + default: + break; + } +} + +River::Mode River::mode() const +{ + return m_mode; +} + +QSize River::fixedSize() +{ + return QSize(352, 416); +} + +//the name of this method is not that good... +void River::makeCenterAvailable(qreal size) +{ + QRectF center(QPointF(), QSizeF(size, size)); + center.moveCenter(rect().center()); + + const QList list = scene()->items(center); + + foreach(QGraphicsItem *item, m_items) { + + if (!list.contains(item)) + continue; + + QPointF pos = item->pos(); + + if (pos.y() < rect().center().y()) { + //item is above center + pos.ry() = center.top() - item->boundingRect().height() - 1; + } else { + //item is below the center + pos.ry() = center.bottom() + 1; + } + QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::Position, scene()); + anim->setEndValue(pos); + anim->setDuration(150); + anim->start(QAbstractAnimation::DeleteWhenStopped); + } +} + + +//this is there just to test small interaction +void River::keyPressEvent ( QKeyEvent * keyEvent ) +{ + switch(keyEvent->key()) + { + case Qt::Key_O: + { + QItemAnimation *anim = new QItemAnimation(this, QItemAnimation::Opacity, scene()); + anim->setDuration(2000); + anim->setEndValue(qreal(.5)); + anim->start(QAbstractAnimation::DeleteWhenStopped); + } + break; + case Qt::Key_N: + //that's a test + makeCenterAvailable(60); + break; + case Qt::Key_P: + switchPaused(); + break; + case Qt::Key_V: + setMode(GridMode); + break; + case Qt::Key_R: + setMode(RiverMode); + break; + case Qt::Key_C: + setMode(CoverMode); + break; + case Qt::Key_Return: + case Qt::Key_Enter: + if (m_mode == RiverMode) { + setMode(GridMode); + } else if (m_mode == GridMode) { + setMode(GridFullScreenMode); + } else if (m_mode == GridFullScreenMode) { + setMode(GridMode); + } + break; + case Qt::Key_Escape: + if (m_mode == GridFullScreenMode) { + setMode(GridMode); + } else if (m_mode == GridMode || m_mode == CoverMode) { + setMode(RiverMode); + } else if (m_mode == RiverMode) { + menu->show(); + } + break; + case Qt::Key_Right: + if (m_mode == GridMode) { + navigateBy(+1); + } else if (m_mode == CoverMode) { + setCurrentItem(m_selectedItem + 1); + } + break; + case Qt::Key_Left: + if (m_mode == GridMode) { + navigateBy(-1); + } else if (m_mode == CoverMode) { + setCurrentItem(m_selectedItem - 1); + } + break; + case Qt::Key_Down: + if (m_mode == GridMode) { + navigateBy(GRID_COLUMN_COUNT); + } + break; + case Qt::Key_Up: + if (m_mode == GridMode) { + navigateBy(-GRID_COLUMN_COUNT); + } + break; +// case Qt::Key_PageUp: + case Qt::Key_M: + menu->show(); + break; + case Qt::Key_Space: + if (m_mode == GridMode) { + RiverItem *item = currentItem(); + if(!item) + break; + + //stupid sequence. + QPointF pos = item->pos(); + QAnimationGroup *group = new QSequentialAnimationGroup(); + //item->animator()->beginSequence(); + + QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::Position, scene()); + anim->setEndValue(pos); + group->addAnimation(anim); + anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene()); + anim->setEndValue(qreal(1.)); + anim->setDuration(500); + group->addAnimation(anim); + anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene()); + anim->setEndValue(qreal(1.)); + anim->setDuration(500); + group->addAnimation(anim); + anim = new QItemAnimation(item, QItemAnimation::RotationX, scene()); + anim->setEndValue(qreal(0)); + group->addAnimation(anim); + group->start(QAbstractAnimation::DeleteWhenStopped); + } + default: + break; + } + + QGraphicsItem::keyPressEvent(keyEvent); +} + + +void River::setGridMode() +{ + setMode(GridMode); +} + +void River::setRiverMode() +{ + setMode(RiverMode); +} + +void River::setCoverMode() +{ + setMode(CoverMode); +} + + +void River::adjustGrid(int newTopLeft) +{ + for (int i = newTopLeft ; i < newTopLeft + GRID_DIMENSIONS; i++) { + if (!m_items.contains(i)) { + RiverItem *item = createItem(i); + int row = (i - m_topLeftIndex) / GRID_COLUMN_COUNT; + int col = (i - m_topLeftIndex) % GRID_COLUMN_COUNT; + item->setPos(gridItemPosition(row, col)); + item->setXScale(0); + item->setYScale(0); + QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene()); + anim->setEndValue(GRID_MAGNIFY); + anim->start(QAbstractAnimation::DeleteWhenStopped); + anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene()); + anim->setEndValue(GRID_MAGNIFY); + anim->start(QAbstractAnimation::DeleteWhenStopped); + } + } + newTopLeft = newTopLeft - newTopLeft % GRID_COLUMN_COUNT; + + QHash::iterator it = m_items.begin(); + while (it != m_items.constEnd()) { + const int imageIdx = it.key(); + RiverItem *item = *it; + QSizeF itemSize = item->boundingRect().size(); + if ((imageIdx >= newTopLeft && imageIdx < newTopLeft + GRID_DIMENSIONS) + || boundingRect().adjusted(-itemSize.width()/2, -itemSize.height()/2, itemSize.width()/2, itemSize.height()/2) + .contains(item->pos())) { + int row = (imageIdx-newTopLeft) / GRID_COLUMN_COUNT; + int col = (imageIdx-newTopLeft) % GRID_COLUMN_COUNT; + QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::Position, scene()); + anim->setEndValue(gridItemPosition(row, col)); + anim->start(QAbstractAnimation::DeleteWhenStopped); + ++it; + } else { + ++it; /* ### ideally we should remove the items, but this cause the photobrowser to crash + because the QItemAnimations are not notified the item is deleted + delete item; + it = m_items.erase(it); + */ + } + } + + m_topLeftIndex = newTopLeft; +} + + +RiverItem *River::createItem(int imageIndex) +{ + Q_ASSERT(!m_items.contains(imageIndex)); + RiverItem * item = new RiverItem(this); + item->setPixmap(pixmap(imageIndex)); + m_items.insert(imageIndex,item); + return item; +} + +void River::setCurrentItem(int newCurrentItem) +{ + if (m_mode == CoverMode) + { + m_selectedItem = newCurrentItem; + for (int i = 0; i < m_gridItem.count(); i++) { + QVariantAnimation *anim; + RiverItem *item = m_gridItem.at(i); + + qreal rotation = 0; + qreal width = boundingRect().width() / 2; + qreal x = width; + qreal scale = 3; + qreal z = 1; + qreal y = boundingRect().height()/2; + + if (i < newCurrentItem - 4) { + item->setVisible(false); + item->setPos(QPointF(0, y)); + continue; + } else if(i > newCurrentItem + 4) { + item->setVisible(false); + item->setPos(QPointF(boundingRect().width(), y)); + continue; + } else if (i < newCurrentItem) { + x = (i - newCurrentItem + 4) * width/7; + rotation = -75; + scale = 2; + z = 1.+qreal(i-newCurrentItem)/10.; + } else if (i > newCurrentItem) { + x = width + (i - newCurrentItem + 3) * width/7; + rotation = 75; + scale = 2; + z = 1.-qreal(i-newCurrentItem)/8.; + } + + item->setVisible(true); + item->setZValue(z); + + anim = new QItemAnimation(item, QItemAnimation::RotationY, scene()); + anim->setEndValue(rotation); + anim->start(QAbstractAnimation::DeleteWhenStopped); + + anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene()); + anim->setEndValue(scale); + anim->start(QVariantAnimation::DeleteWhenStopped); + + anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene()); + anim->setEndValue(scale); + anim->start(QVariantAnimation::DeleteWhenStopped); + + anim = new QItemAnimation(item, QItemAnimation::Position, scene()); + anim->setEndValue(QPointF(x,y)); + anim->start(QVariantAnimation::DeleteWhenStopped); + } + return; + } + + + //deselect the current item + if (m_selectedItem >= 0 && m_items.contains(m_selectedItem)) { + RiverItem *item = m_items.value(m_selectedItem); + item->setZValue(qreal(qrand()%100)/200.0); + QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene()); + anim->setEndValue(GRID_MAGNIFY); + anim->start(QAbstractAnimation::DeleteWhenStopped); + anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene()); + anim->setEndValue(GRID_MAGNIFY); + anim->start(QAbstractAnimation::DeleteWhenStopped); + } + + if (newCurrentItem < 0) { + m_selectedItem = newCurrentItem; + return; + } + + //ensure visible; + if (newCurrentItem < m_topLeftIndex) { + adjustGrid(newCurrentItem); + } else if (newCurrentItem >= m_topLeftIndex + GRID_DIMENSIONS) { + adjustGrid(newCurrentItem - GRID_DIMENSIONS + GRID_COLUMN_COUNT); + } + + //select the new one + m_selectedItem = newCurrentItem; + RiverItem *item = currentItem(); + Q_ASSERT(item); + item->setZValue(1); + + QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene()); + anim->setEndValue(GRID_CURRENT_MAGNIFY); + anim->start(QAbstractAnimation::DeleteWhenStopped); + anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene()); + anim->setEndValue(GRID_CURRENT_MAGNIFY); + anim->start(QAbstractAnimation::DeleteWhenStopped); +} + +void River::navigateBy(int offset) +{ + int newSelection = m_selectedItem + offset; + const int imageCount = m_images.size(); + while (newSelection < 0) + newSelection += imageCount; + newSelection %= imageCount; + setCurrentItem(newSelection); +} diff --git a/examples/animation/research/photobrowser/river.h b/examples/animation/research/photobrowser/river.h new file mode 100644 index 0000000..d6bfc76 --- /dev/null +++ b/examples/animation/research/photobrowser/river.h @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 __RIVER__H__ +#define __RIVER__H__ + +#include +#include + +#include "menu.h" + +class RiverItem; + +class River : public QGraphicsWidget +{ + Q_OBJECT +public: + enum Mode + { + RiverMode, + GridMode, + GridFullScreenMode, + CoverMode + }; + + River(const QString &path); + void addUnusedRiverItem(RiverItem * item); + + static QSize fixedSize(); + + void switchPaused(); + + void setMode(Mode m); + Mode mode() const; + + Menu *menu; + +protected: + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + void keyPressEvent ( QKeyEvent * keyEvent ); + void makeCenterAvailable(qreal size); + QPointF gridItemPosition(int row, int col) const; + QPixmap pixmap(int index) const; + +protected slots: + void animationFinished(); +public slots: + void setRiverMode(); + void setGridMode(); + void setCoverMode(); + +private: + const QFileInfoList m_images; + int m_currentImage; + mutable QVector m_pixmaps; + QHash m_items; + QList m_gridItem; + QList m_pausedAnimations; + Mode m_mode; + + void adjustGrid(int topRight); + RiverItem *currentItem() { return m_items.value(m_selectedItem); } + RiverItem *createItem(int imageIndex); + void setCurrentItem(int currentItem); + void navigateBy(int offset); + + int m_selectedItem; + int m_topLeftIndex; + +}; + + +#endif //__RIVERITEM__H__ diff --git a/examples/animation/research/photobrowser/riveritem.cpp b/examples/animation/research/photobrowser/riveritem.cpp new file mode 100644 index 0000000..9692d30 --- /dev/null +++ b/examples/animation/research/photobrowser/riveritem.cpp @@ -0,0 +1,125 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 "riveritem.h" +#include "river.h" + +RiverItem::RiverItem(QGraphicsItem *parent) : QGraphicsPixmapItem(parent), m_fullscreen(false) +{ + setCacheMode(DeviceCoordinateCache); +} + +RiverItem::~RiverItem() +{ +} + +void RiverItem::setPixmap(const QPixmap &pix) +{ + const QSize oldSize = pixmap().size(); + const QSize newSize = pix.size(); + QGraphicsPixmapItem::setPixmap(pix); + + if (newSize != oldSize) { + setOffset(-newSize.width()/2, -newSize.height()/2); + const qreal scaleFactor = qreal(River::fixedSize().height())/(qreal(pix.height()*7)); + setTransform(QTransform().scale(scaleFactor, scaleFactor)); + prepareGeometryChange(); + } +} + + +void RiverItem::setFullScreen(bool b, qreal originScaleFactor) +{ + if (m_fullscreen == b) + return; + + m_fullscreen = b; + + QPointF newPos; + qreal rotationZ; + qreal scaleX, scaleY; + + if (b) { + const QSizeF basePixmapSize = transform().map(boundingRect()).boundingRect().size(); + + newPos = parentItem()->boundingRect().center(); + rotationZ = 90; + scaleY = qreal(River::fixedSize().width()) / basePixmapSize.height() * yScale(); + scaleX = qreal(River::fixedSize().height()) / basePixmapSize.width() * xScale(); + + if (m_nonFSPos.isNull()) { + m_nonFSPos = pos(); //let's save our current (non fullscreen) position + } + + } else { + Q_ASSERT(!m_nonFSPos.isNull()); + rotationZ = 0; + scaleX = originScaleFactor; + scaleY = originScaleFactor; + newPos = m_nonFSPos; + } + + QAnimationGroup *group = new QParallelAnimationGroup(scene()); + QItemAnimation *anim = new QItemAnimation(this, QItemAnimation::Position); + anim->setEndValue(newPos); + group->addAnimation(anim); + anim = new QItemAnimation(this, QItemAnimation::RotationZ); + anim->setEndValue(rotationZ); + group->addAnimation(anim); + anim = new QItemAnimation(this, QItemAnimation::ScaleFactorX); + anim->setEndValue(scaleX); + group->addAnimation(anim); + anim = new QItemAnimation(this, QItemAnimation::ScaleFactorY); + anim->setEndValue(scaleY); + group->addAnimation(anim); + group->start(QAbstractAnimation::DeleteWhenStopped); +} + +void RiverItem::mousePressEvent(QGraphicsSceneMouseEvent*) +{ + //just let it rotate on itself + QItemAnimation *anim = new QItemAnimation(this, QItemAnimation::RotationY); + anim->setEndValue(yRotation() < 180 ? 360 : 0); + anim->setDuration(500); + anim->start(QAbstractAnimation::DeleteWhenStopped); +} + + diff --git a/examples/animation/research/photobrowser/riveritem.h b/examples/animation/research/photobrowser/riveritem.h new file mode 100644 index 0000000..2023c44 --- /dev/null +++ b/examples/animation/research/photobrowser/riveritem.h @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 __RIVERITEM__H__ +#define __RIVERITEM__H__ + +#include + +class RiverItemAnimator; + +class RiverItem : public QGraphicsPixmapItem +{ +public: + RiverItem(QGraphicsItem *parent); + ~RiverItem(); + + void setPixmap(const QPixmap &); + void setFullScreen(bool b, qreal originScaleFactor); + +protected: + void mousePressEvent(QGraphicsSceneMouseEvent*); + +private: + QPointF m_nonFSPos; //to save the position when not in fullscreen + bool m_fullscreen; +}; + +#endif //__RIVERITEM__H__ diff --git a/examples/animation/research/piemenu/main.cpp b/examples/animation/research/piemenu/main.cpp new file mode 100644 index 0000000..8076da8 --- /dev/null +++ b/examples/animation/research/piemenu/main.cpp @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 +#include "scene.h" +#include "qgraphicspiemenu.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + Scene scene; + + QGraphicsView view(&scene); + view.show(); + + return app.exec(); +} diff --git a/examples/animation/research/piemenu/piemenu.pro b/examples/animation/research/piemenu/piemenu.pro new file mode 100644 index 0000000..4d7a067 --- /dev/null +++ b/examples/animation/research/piemenu/piemenu.pro @@ -0,0 +1,8 @@ +SOURCES += \ + main.cpp \ + qgraphicspiemenu.cpp \ + scene.cpp +HEADERS += \ + qgraphicspiemenu.h \ + qgraphicspiemenu_p.h \ + scene.h diff --git a/examples/animation/research/piemenu/qgraphicspiemenu.cpp b/examples/animation/research/piemenu/qgraphicspiemenu.cpp new file mode 100644 index 0000000..a199119 --- /dev/null +++ b/examples/animation/research/piemenu/qgraphicspiemenu.cpp @@ -0,0 +1,250 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 "qgraphicspiemenu.h" +#include "qgraphicspiemenu_p.h" + +#include + +QGraphicsPieMenu::QGraphicsPieMenu(QGraphicsItem *parent) + : QGraphicsWidget(parent), d_ptr(new QGraphicsPieMenuPrivate) +{ + d_ptr->q_ptr = this; + d_ptr->machine = new QStateMachine(); + d_ptr->popupState = new QState(d_ptr->machine->rootState()); + d_ptr->machine->setInitialState(d_ptr->popupState); + d_ptr->menuAction = new QAction(this); +} + +QGraphicsPieMenu::QGraphicsPieMenu(const QString &title, QGraphicsItem *parent) + : QGraphicsWidget(parent), d_ptr(new QGraphicsPieMenuPrivate) +{ + d_ptr->q_ptr = this; + d_ptr->machine = new QStateMachine(); + d_ptr->popupState = new QState(d_ptr->machine->rootState()); + d_ptr->machine->setInitialState(d_ptr->popupState); + d_ptr->menuAction = new QAction(this); + setTitle(title); +} + +QGraphicsPieMenu::QGraphicsPieMenu(const QIcon &icon, const QString &title, QGraphicsItem *parent) + : QGraphicsWidget(parent), d_ptr(new QGraphicsPieMenuPrivate) +{ + d_ptr->q_ptr = this; + d_ptr->machine = new QStateMachine(); + d_ptr->popupState = new QState(d_ptr->machine->rootState()); + d_ptr->machine->setInitialState(d_ptr->popupState); + d_ptr->menuAction = new QAction(this); + setIcon(icon); + setTitle(title); +} + +QGraphicsPieMenu::~QGraphicsPieMenu() +{ + delete d_ptr; +} + +QAction *QGraphicsPieMenu::addAction(const QString &text) +{ + QAction *action = new QAction(text, this); + addAction(action); + return action; +} + +QAction *QGraphicsPieMenu::addAction(const QIcon &icon, const QString &text) +{ + QAction *action = new QAction(icon, text, this); + addAction(action); + return action; +} + +QAction *QGraphicsPieMenu::addAction(const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut) +{ + QAction *action = new QAction(text, this); + action->setShortcut(shortcut); + connect(action, SIGNAL(triggered(bool)), receiver, member); + addAction(action); + return action; +} + +QAction *QGraphicsPieMenu::addAction(const QIcon &icon, const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut) +{ + QAction *action = new QAction(icon, text, this); + action->setShortcut(shortcut); + connect(action, SIGNAL(triggered(bool)), receiver, member); + addAction(action); + return action; +} + +QAction *QGraphicsPieMenu::addMenu(QGraphicsPieMenu *menu) +{ + QAction *action = menu->menuAction(); + addAction(action); + return action; +} + +QGraphicsPieMenu *QGraphicsPieMenu::addMenu(const QString &title) +{ + QGraphicsPieMenu *menu = new QGraphicsPieMenu(title, this); + addMenu(menu); + return menu; +} + +QGraphicsPieMenu *QGraphicsPieMenu::addMenu(const QIcon &icon, const QString &title) +{ + QGraphicsPieMenu *menu = new QGraphicsPieMenu(icon, title, this); + addMenu(menu); + return menu; +} + +QAction *QGraphicsPieMenu::addSeparator() +{ + QAction *action = new QAction(this); + action->setSeparator(true); + addAction(action); + return action; +} + +QAction *QGraphicsPieMenu::insertMenu(QAction *before, QGraphicsPieMenu *menu) +{ + QAction *action = menu->menuAction(); + insertAction(before, action); + return action; +} + +QAction *QGraphicsPieMenu::insertSeparator(QAction *before) +{ + QAction *action = new QAction(this); + action->setSeparator(true); + insertAction(before, action); + return action; +} + +QAction *QGraphicsPieMenu::menuAction() const +{ + return d_func()->menuAction; +} + +bool QGraphicsPieMenu::isEmpty() const +{ + // ### d->actions + QList actionList = actions(); + bool ret = true; + for (int i = 0; ret && i < actionList.size(); ++i) { + const QAction *action = actionList.at(i); + if (!action->isSeparator() && action->isVisible()) { + ret = false; + break; + } + } + return ret; +} + +void QGraphicsPieMenu::clear() +{ + // ### d->actions + QList actionList = actions(); + for(int i = 0; i < actionList.size(); i++) { + QAction *action = actionList.at(i); + removeAction(action); + if (action->parent() == this && action->associatedGraphicsWidgets().isEmpty()) + delete action; + } +} + +void QGraphicsPieMenu::popup(const QPointF &pos) +{ + Q_UNUSED(pos); + Q_D(QGraphicsPieMenu); + d->machine->start(); +} + +QAction *QGraphicsPieMenu::exec() +{ + return exec(pos()); +} + +QAction *QGraphicsPieMenu::exec(const QPointF &pos) +{ + Q_UNUSED(pos); + return 0; +} + +QAction *QGraphicsPieMenu::exec(QList actions, const QPointF &pos) +{ + QGraphicsPieMenu menu; + for (QList::ConstIterator it = actions.constBegin(); it != actions.constEnd(); ++it) + menu.addAction(*it); + return menu.exec(pos); +} + +QString QGraphicsPieMenu::title() const +{ + Q_D(const QGraphicsPieMenu); + return d->title; +} + +void QGraphicsPieMenu::setTitle(const QString &title) +{ + Q_D(QGraphicsPieMenu); + d->title = title; + updateGeometry(); +} + +QIcon QGraphicsPieMenu::icon() const +{ + Q_D(const QGraphicsPieMenu); + return d->icon; +} + +void QGraphicsPieMenu::setIcon(const QIcon &icon) +{ + Q_D(QGraphicsPieMenu); + d->icon = icon; + updateGeometry(); +} + +QSizeF QGraphicsPieMenu::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const +{ + Q_UNUSED(which); + Q_UNUSED(constraint); + return QSizeF(1, 1); +} diff --git a/examples/animation/research/piemenu/qgraphicspiemenu.h b/examples/animation/research/piemenu/qgraphicspiemenu.h new file mode 100644 index 0000000..d784f93 --- /dev/null +++ b/examples/animation/research/piemenu/qgraphicspiemenu.h @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 QGRAPHICSPIEMENU_H +#define QGRAPHICSPIEMENU_H + +#include + +class QGraphicsPieMenuPrivate; +class QGraphicsPieMenu : public QGraphicsWidget +{ + Q_OBJECT +public: + QGraphicsPieMenu(QGraphicsItem *parent = 0); + QGraphicsPieMenu(const QString &title, QGraphicsItem *parent = 0); + QGraphicsPieMenu(const QIcon &icon, const QString &title, QGraphicsItem *parent = 0); + ~QGraphicsPieMenu(); + +#ifdef Q_NO_USING_KEYWORD + inline void addAction(QAction *action) { QGraphicsWidget::addAction(action); } +#else + using QGraphicsWidget::addAction; +#endif + QAction *addAction(const QString &text); + QAction *addAction(const QIcon &icon, const QString &text); + QAction *addAction(const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut = 0); + QAction *addAction(const QIcon &icon, const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut = 0); + QAction *addMenu(QGraphicsPieMenu *menu); + QGraphicsPieMenu *addMenu(const QString &title); + QGraphicsPieMenu *addMenu(const QIcon &icon, const QString &title); + QAction *addSeparator(); + QAction *insertMenu(QAction *before, QGraphicsPieMenu *menu); + QAction *insertSeparator(QAction *before); + + QAction *menuAction() const; + + bool isEmpty() const; + void clear(); + + void popup(const QPointF &pos); + QAction *exec(); + QAction *exec(const QPointF &pos); + static QAction *exec(QList actions, const QPointF &pos); + + QString title() const; + void setTitle(const QString &title); + + QIcon icon() const; + void setIcon(const QIcon &icon); + +Q_SIGNALS: + void aboutToShow(); + void aboutToHide(); + void triggered(QAction *action); + void hovered(QAction *action); + +protected: + QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; + +private: + Q_DISABLE_COPY(QGraphicsPieMenu) + Q_DECLARE_PRIVATE(QGraphicsPieMenu) + QGraphicsPieMenuPrivate *d_ptr; +}; + +#endif diff --git a/examples/animation/research/piemenu/qgraphicspiemenu_p.h b/examples/animation/research/piemenu/qgraphicspiemenu_p.h new file mode 100644 index 0000000..458b8f1 --- /dev/null +++ b/examples/animation/research/piemenu/qgraphicspiemenu_p.h @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 QGRAPHICSPIEMENU_P_H +#define QGRAPHICSPIEMENU_P_H + +#include "qgraphicspiemenu.h" +#include "qgraphicspiemenusection_p.h" + +#include +#include +#include +#include + +class QAction; +class QEventLoop; +class QGraphicsPieMenuSection; + +class QGraphicsPieMenuPrivate +{ + Q_DECLARE_PUBLIC(QGraphicsPieMenu); +public: + void init(const QIcon &icon = QIcon(), const QString &title = QString()); + + QIcon icon; + QString title; + QStateMachine *machine; + QState *popupState; + //QTransition *transition; + QList sections; + + QEventLoop *eventLoop; + + QAction *menuAction; + QGraphicsPieMenu *q_ptr; + + void updatePopupState(); +}; + +#endif diff --git a/examples/animation/research/piemenu/qgraphicspiemenusection_p.h b/examples/animation/research/piemenu/qgraphicspiemenusection_p.h new file mode 100644 index 0000000..2d71a06 --- /dev/null +++ b/examples/animation/research/piemenu/qgraphicspiemenusection_p.h @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 QGRAPHICSPIEMENUSECTION_H +#define QGRAPHICSPIEMENUSECTION_H + +#include +#include + +class QGraphicsPieMenuSection : public QGraphicsWidget +{ + Q_OBJECT + Q_PROPERTY(qreal rotation READ rotation WRITE setRotation) +public: + QGraphicsPieMenuSection(QGraphicsItem *parent = 0) + : QGraphicsWidget(parent), rot(0) + { } + + qreal rotation() const + { + return rot; + } + void setRotation(qreal rotation) + { + rot = rotation; + setTransform(QTransform().rotate(rot)); + } + + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) + { + Q_UNUSED(option); + Q_UNUSED(widget); + painter->setPen(QPen(Qt::black, 1)); + painter->setBrush(QBrush(Qt::gray)); + painter->drawPie(QRectF(-100, -100, 200, 200), 0, -30 * 16); + } + +protected: + QSizeF sizeHint(Qt::SizeHint which, const QSizeF &size = QSizeF()) const + { + Q_UNUSED(which); + Q_UNUSED(size); + return QSizeF(100, 30); + } + +private: + qreal rot; +}; + +#endif diff --git a/examples/animation/research/piemenu/scene.cpp b/examples/animation/research/piemenu/scene.cpp new file mode 100644 index 0000000..6309975 --- /dev/null +++ b/examples/animation/research/piemenu/scene.cpp @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 "qgraphicspiemenu.h" +#include "scene.h" + +#include +#include + +Scene::Scene(qreal x, qreal y, qreal width, qreal height, QObject *parent) + : QGraphicsScene(x, y, width, height, parent) +{ +} + +Scene::Scene(const QRectF &sceneRect, QObject *parent) + : QGraphicsScene(sceneRect, parent) +{ +} + +Scene::Scene(QObject *parent) + : QGraphicsScene(parent) +{ +} + +Scene::~Scene() +{ +} + +void Scene::mousePressEvent(QGraphicsSceneMouseEvent *event) +{ + QGraphicsPieMenu *menu = new QGraphicsPieMenu; + for (int i = 0; i < 5; ++i) + menu->addAction(new QAction(QString("Item %1").arg(i), menu)); + menu->popup(event->scenePos()); +} diff --git a/examples/animation/research/piemenu/scene.h b/examples/animation/research/piemenu/scene.h new file mode 100644 index 0000000..bbfe6d3 --- /dev/null +++ b/examples/animation/research/piemenu/scene.h @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore 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 SCENE_H +#define SCENE_H + +#include + +class Scene : public QGraphicsScene +{ + Q_OBJECT +public: + Scene(qreal x, qreal y, qreal width, qreal height, QObject *parent = 0); + Scene(const QRectF &sceneRect, QObject *parent = 0); + Scene(QObject *parent = 0); + ~Scene(); + +protected: + void mousePressEvent(QGraphicsSceneMouseEvent *event); +}; + +#endif -- cgit v0.12 From f9ad96ae0315d2dd527507ed8875830c34673410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Thu, 23 Apr 2009 22:50:35 +0200 Subject: Remove trailing whitespace --- src/3rdparty/easing/easing.cpp | 64 +++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/3rdparty/easing/easing.cpp b/src/3rdparty/easing/easing.cpp index 6a98c98..340be86 100644 --- a/src/3rdparty/easing/easing.cpp +++ b/src/3rdparty/easing/easing.cpp @@ -37,36 +37,36 @@ static qreal easeNone(qreal progress) { return progress; } - + /** * Easing equation function for a quadratic (t^2) easing in: accelerating from zero velocity. * * @param t Current time (in frames or seconds). * @return The correct value. */ -static qreal easeInQuad(qreal t) +static qreal easeInQuad(qreal t) { return t*t; } - + /** * Easing equation function for a quadratic (t^2) easing out: decelerating to zero velocity. * * @param t Current time (in frames or seconds). * @return The correct value. */ -static qreal easeOutQuad(qreal t) +static qreal easeOutQuad(qreal t) { return -t*(t-2); } - + /** * Easing equation function for a quadratic (t^2) easing in/out: acceleration until halfway, then deceleration. * * @param t Current time (in frames or seconds). * @return The correct value. */ -static qreal easeInOutQuad(qreal t) +static qreal easeInOutQuad(qreal t) { t*=2.0; if (t < 1) { @@ -76,7 +76,7 @@ static qreal easeInOutQuad(qreal t) return -0.5 * (t*(t-2) - 1); } } - + /** * Easing equation function for a quadratic (t^2) easing out/in: deceleration until halfway, then acceleration. * @@ -88,7 +88,7 @@ static qreal easeOutInQuad(qreal t) if (t < 0.5) return easeOutQuad (t*2)/2; return easeInQuad((2*t)-1)/2 + 0.5; } - + /** * Easing equation function for a cubic (t^3) easing in: accelerating from zero velocity. * @@ -99,7 +99,7 @@ static qreal easeInCubic(qreal t) { return t*t*t; } - + /** * Easing equation function for a cubic (t^3) easing out: decelerating from zero velocity. * @@ -111,7 +111,7 @@ static qreal easeOutCubic(qreal t) t-=1.0; return t*t*t + 1; } - + /** * Easing equation function for a cubic (t^3) easing in/out: acceleration until halfway, then deceleration. * @@ -151,7 +151,7 @@ static qreal easeInQuart(qreal t) { return t*t*t*t; } - + /** * Easing equation function for a quartic (t^4) easing out: decelerating from zero velocity. * @@ -163,7 +163,7 @@ static qreal easeOutQuart(qreal t) t-= qreal(1.0); return - (t*t*t*t- 1); } - + /** * Easing equation function for a quartic (t^4) easing in/out: acceleration until halfway, then deceleration. * @@ -178,7 +178,7 @@ static qreal easeInOutQuart(qreal t) t -= 2.0f; return -0.5 * (t*t*t*t- 2); } -} +} /** * Easing equation function for a quartic (t^4) easing out/in: deceleration until halfway, then acceleration. @@ -186,12 +186,12 @@ static qreal easeInOutQuart(qreal t) * @param t Current time (in frames or seconds). * @return The correct value. */ -static qreal easeOutInQuart(qreal t) +static qreal easeOutInQuart(qreal t) { if (t < 0.5) return easeOutQuart (2*t)/2; return easeInQuart(2*t-1)/2 + 0.5; } - + /** * Easing equation function for a quintic (t^5) easing in: accelerating from zero velocity. * @@ -202,7 +202,7 @@ static qreal easeInQuint(qreal t) { return t*t*t*t*t; } - + /** * Easing equation function for a quintic (t^5) easing out: decelerating from zero velocity. * @@ -214,7 +214,7 @@ static qreal easeOutQuint(qreal t) t-=1.0; return t*t*t*t*t + 1; } - + /** * Easing equation function for a quintic (t^5) easing in/out: acceleration until halfway, then deceleration. * @@ -230,7 +230,7 @@ static qreal easeInOutQuint(qreal t) return 0.5*(t*t*t*t*t + 2); } } - + /** * Easing equation function for a quintic (t^5) easing out/in: deceleration until halfway, then acceleration. * @@ -242,7 +242,7 @@ static qreal easeOutInQuint(qreal t) if (t < 0.5) return easeOutQuint (2*t)/2; return easeInQuint(2*t - 1)/2 + 0.5; } - + /** * Easing equation function for a sinusoidal (sin(t)) easing in: accelerating from zero velocity. * @@ -253,7 +253,7 @@ static qreal easeInSine(qreal t) { return (t == 1.0) ? 1.0 : -::cos(t * M_PI_2) + 1.0; } - + /** * Easing equation function for a sinusoidal (sin(t)) easing out: decelerating from zero velocity. * @@ -264,7 +264,7 @@ static qreal easeOutSine(qreal t) { return ::sin(t* M_PI_2); } - + /** * Easing equation function for a sinusoidal (sin(t)) easing in/out: acceleration until halfway, then deceleration. * @@ -275,7 +275,7 @@ static qreal easeInOutSine(qreal t) { return -0.5 * (::cos(M_PI*t) - 1); } - + /** * Easing equation function for a sinusoidal (sin(t)) easing out/in: deceleration until halfway, then acceleration. * @@ -287,7 +287,7 @@ static qreal easeOutInSine(qreal t) if (t < 0.5) return easeOutSine (2*t)/2; return easeInSine(2*t - 1)/2 + 0.5; } - + /** * Easing equation function for an exponential (2^t) easing in: accelerating from zero velocity. * @@ -336,7 +336,7 @@ static qreal easeOutInExpo(qreal t) if (t < 0.5) return easeOutExpo (2*t)/2; return easeInExpo(2*t - 1)/2 + 0.5; } - + /** * Easing equation function for a circular (sqrt(1-t^2)) easing in: accelerating from zero velocity. * @@ -563,7 +563,7 @@ static qreal easeOutBounce_helper(qreal t, qreal b, qreal c, qreal a) return -a * (1. - (7.5625*t*t + .984375)) + (b + c); } } - + /** * Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out: decelerating from zero velocity. * @@ -587,8 +587,8 @@ static qreal easeInBounce(qreal t, qreal a) { return 1.0 - easeOutBounce_helper(1.0-t, 0, 1.0, a); } - - + + /** * Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in/out: acceleration until halfway, then deceleration. * @@ -601,7 +601,7 @@ static qreal easeInOutBounce(qreal t, qreal a) if (t < 0.5) return easeInBounce (2*t, a)/2; else return (t == 1.0) ? 1.0 : easeOutBounce (2*t - 1, a)/2 + 0.5; } - + /** * Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out/in: deceleration until halfway, then acceleration. * @@ -633,7 +633,7 @@ static inline qreal qt_smoothBeginEndMixFactor(qreal value) /** * Easing function that starts growing slowly, then increases in speed. At the end of the curve the speed will be constant. */ -static qreal easeInCurve(qreal t) +static qreal easeInCurve(qreal t) { const qreal sinProgress = qt_sinProgress(t); const qreal mix = qt_smoothBeginEndMixFactor(t); @@ -643,7 +643,7 @@ static qreal easeInCurve(qreal t) /** * Easing function that starts growing steadily, then ends slowly. The speed will be constant at the beginning of the curve. */ -static qreal easeOutCurve(qreal t) +static qreal easeOutCurve(qreal t) { const qreal sinProgress = qt_sinProgress(t); const qreal mix = qt_smoothBeginEndMixFactor(1 - t); @@ -653,7 +653,7 @@ static qreal easeOutCurve(qreal t) /** * Easing function where the value grows sinusoidally. Note that the calculated end value will be 0 rather than 1. */ -static qreal easeSineCurve(qreal t) +static qreal easeSineCurve(qreal t) { return (qSin(((t * M_PI * 2)) - M_PI_2) + 1) / 2; } @@ -662,7 +662,7 @@ static qreal easeSineCurve(qreal t) * Easing function where the value grows cosinusoidally. Note that the calculated start value will be 0.5 and the end value will be 0.5 * contrary to the usual 0 to 1 easing curve. */ -static qreal easeCosineCurve(qreal t) +static qreal easeCosineCurve(qreal t) { return (qCos(((t * M_PI * 2)) - M_PI_2) + 1) / 2; } -- cgit v0.12 From eaa9cedb527b59bdc58ea87a464f2a6c842246e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Thu, 23 Apr 2009 22:52:29 +0200 Subject: Remove trailing whitespace --- tests/auto/qeasingcurve/tst_qeasingcurve.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp index 9e3ffcc..4a16f51 100644 --- a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp +++ b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp @@ -96,17 +96,17 @@ void tst_QEasingCurve::type() QEasingCurve curve(QEasingCurve::Linear); QCOMPARE(curve.period(), 0.3); QCOMPARE(curve.amplitude(), 1.0); - + curve.setPeriod(5); curve.setAmplitude(3); QCOMPARE(curve.period(), 5.0); QCOMPARE(curve.amplitude(), 3.0); - + curve.setType(QEasingCurve::InElastic); QCOMPARE(curve.period(), 5.0); QCOMPARE(curve.amplitude(), 3.0); } - + { QEasingCurve curve(QEasingCurve::InElastic); QCOMPARE(curve.period(), 0.3); @@ -132,7 +132,7 @@ void tst_QEasingCurve::type() QTest::ignoreMessage(QtWarningMsg, QString::fromAscii("QEasingCurve: Invalid curve type %1") .arg(QEasingCurve::Custom).toLatin1().constData()); curve.setType(QEasingCurve::Custom); - QCOMPARE(curve.type(), QEasingCurve::InCubic); + QCOMPARE(curve.type(), QEasingCurve::InCubic); QTest::ignoreMessage(QtWarningMsg, QString::fromAscii("QEasingCurve: Invalid curve type %1") .arg(-1).toLatin1().constData()); curve.setType((QEasingCurve::Type)-1); @@ -386,12 +386,12 @@ void tst_QEasingCurve::valueForProgress() QString strCurve = QLatin1String(mo.enumerator(mo.indexOfEnumerator("Type")).key(c)); QString strInputs; QString strOutputs; - + for (int t = 0; t <= 100; t+= 20) { qreal ease = curve.valueForProgress(t/qreal(100)); strInputs += QString::fromAscii(" << %1").arg(t); strOutputs += QString::fromAscii(" << %1").arg(int(100*ease)); - + } QString str = QString::fromAscii(" QTest::newRow(\"%1\") << int(QEasingCurve::%2)\n" "\t\t << (IntList() %3)\n" @@ -460,14 +460,14 @@ void tst_QEasingCurve::operators() QCOMPARE(curve2.valueForProgress(0.25), 0.2); QCOMPARE(curve2.valueForProgress(0.35), 0.3); QCOMPARE(curve2.valueForProgress(0.999999), 0.9); - + // operator== curve.setType(QEasingCurve::InBack); curve2 = curve; curve2.setOvershoot(qreal(1.70158f)); QCOMPARE(curve.overshoot(), curve2.overshoot()); QVERIFY(curve2 == curve); - + curve.setOvershoot(3.0); QVERIFY(curve2 != curve); curve2.setOvershoot(3.0); -- cgit v0.12 From 686f82e51124747cbe650d04dfb053830b6660fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Thu, 23 Apr 2009 23:25:35 +0200 Subject: Fix a bug in the ease{In,Out}Bounce easing functions + small cleanup. The bug was in easeOutBounce_helper(), where the last else-block adjusted t wrong. It should adjust t so that the peak is at t == 0, but it adjusted it too little. The old code did t -= (2.25f/2.75f), but it should have been 21/22. The rest of the changes in that function is just simple mathematical rewrites (use a more readable fraction), and removed the b argument, since that was always 0. Finally, fixing the original bug also revealed a bug in the first line of easeOutBounce_helper(), where we always returned 1.0 for t == 1.0. That was wrong since it did not respect c. --- src/3rdparty/easing/easing.cpp | 34 ++--- tests/auto/qeasingcurve/tst_qeasingcurve.cpp | 183 +++++++++++++-------------- 2 files changed, 108 insertions(+), 109 deletions(-) diff --git a/src/3rdparty/easing/easing.cpp b/src/3rdparty/easing/easing.cpp index 340be86..9177c26 100644 --- a/src/3rdparty/easing/easing.cpp +++ b/src/3rdparty/easing/easing.cpp @@ -547,20 +547,20 @@ static qreal easeOutInBack(qreal t, qreal s) return easeInBack(2*t - 1, s)/2 + 0.5; } -static qreal easeOutBounce_helper(qreal t, qreal b, qreal c, qreal a) -{ - if (t == 1.0) return 1.0; - if (t < (1/2.75)) { - return c*(7.5625*t*t) + b; - } else if (t < (2/2.75)) { - t -= (1.5f/2.75f); - return -a * (1. - (7.5625*t*t + .75)) + (b + c); - } else if (t < (2.5/2.75)) { - t -= (2.25f/2.75f); - return -a * (1. - (7.5625*t*t + .9375)) + (b + c); +static qreal easeOutBounce_helper(qreal t, qreal c, qreal a) +{ + if (t == 1.0) return c; + if (t < (4/11.0)) { + return c*(7.5625*t*t); + } else if (t < (8/11.0)) { + t -= (6/11.0); + return -a * (1. - (7.5625*t*t + .75)) + c; + } else if (t < (10/11.0)) { + t -= (9/11.0); + return -a * (1. - (7.5625*t*t + .9375)) + c; } else { - t -= (2.65f/2.75f); - return -a * (1. - (7.5625*t*t + .984375)) + (b + c); + t -= (21/22.0); + return -a * (1. - (7.5625*t*t + .984375)) + c; } } @@ -573,7 +573,7 @@ static qreal easeOutBounce_helper(qreal t, qreal b, qreal c, qreal a) */ static qreal easeOutBounce(qreal t, qreal a) { - return easeOutBounce_helper(t, 0, 1, a); + return easeOutBounce_helper(t, 1, a); } /** @@ -585,7 +585,7 @@ static qreal easeOutBounce(qreal t, qreal a) */ static qreal easeInBounce(qreal t, qreal a) { - return 1.0 - easeOutBounce_helper(1.0-t, 0, 1.0, a); + return 1.0 - easeOutBounce_helper(1.0-t, 1.0, a); } @@ -611,8 +611,8 @@ static qreal easeInOutBounce(qreal t, qreal a) */ static qreal easeOutInBounce(qreal t, qreal a) { - if (t < 0.5) return easeOutBounce_helper(t*2, 0, 0.5, a); - return 1.0 - easeOutBounce_helper (2.0-2*t, 0.0, 0.5, a); + if (t < 0.5) return easeOutBounce_helper(t*2, 0.5, a); + return 1.0 - easeOutBounce_helper (2.0-2*t, 0.5, a); } static inline qreal qt_sinProgress(qreal value) diff --git a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp index 4a16f51..8d42e5e 100644 --- a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp +++ b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp @@ -191,185 +191,184 @@ void tst_QEasingCurve::valueForProgress_data() // integer values and avoid fp inaccuracies QTest::newRow("Linear") << int(QEasingCurve::Linear) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100); QTest::newRow("InQuad") << int(QEasingCurve::InQuad) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 4 << 16 << 36 << 64 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 1 << 4 << 9 << 16 << 25 << 36 << 48 << 64 << 81 << 100); QTest::newRow("OutQuad") << int(QEasingCurve::OutQuad) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 36 << 64 << 84 << 96 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 19 << 36 << 51 << 64 << 75 << 84 << 90 << 96 << 99 << 100); QTest::newRow("InOutQuad") << int(QEasingCurve::InOutQuad) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 8 << 32 << 68 << 92 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 2 << 8 << 18 << 32 << 50 << 68 << 82 << 92 << 98 << 100); QTest::newRow("OutInQuad") << int(QEasingCurve::OutInQuad) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 32 << 48 << 52 << 68 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 18 << 32 << 42 << 48 << 50 << 52 << 57 << 68 << 82 << 100); QTest::newRow("InCubic") << int(QEasingCurve::InCubic) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 0 << 6 << 21 << 51 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 0 << 0 << 2 << 6 << 12 << 21 << 34 << 51 << 72 << 100); QTest::newRow("OutCubic") << int(QEasingCurve::OutCubic) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 48 << 78 << 93 << 99 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 27 << 48 << 65 << 78 << 87 << 93 << 97 << 99 << 99 << 100); QTest::newRow("InOutCubic") << int(QEasingCurve::InOutCubic) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 3 << 25 << 74 << 96 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 0 << 3 << 10 << 25 << 50 << 74 << 89 << 96 << 99 << 100); QTest::newRow("OutInCubic") << int(QEasingCurve::OutInCubic) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 39 << 49 << 50 << 60 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 24 << 39 << 46 << 49 << 50 << 50 << 53 << 60 << 75 << 100); QTest::newRow("InQuart") << int(QEasingCurve::InQuart) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 0 << 2 << 12 << 40 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 0 << 0 << 0 << 2 << 6 << 12 << 24 << 40 << 65 << 100); QTest::newRow("OutQuart") << int(QEasingCurve::OutQuart) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 59 << 87 << 97 << 99 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 34 << 59 << 75 << 87 << 93 << 97 << 99 << 99 << 99 << 100); QTest::newRow("InOutQuart") << int(QEasingCurve::InOutQuart) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 1 << 20 << 79 << 98 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 0 << 1 << 6 << 20 << 50 << 79 << 93 << 98 << 99 << 100); QTest::newRow("OutInQuart") << int(QEasingCurve::OutInQuart) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 43 << 49 << 50 << 56 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 29 << 43 << 48 << 49 << 50 << 50 << 51 << 56 << 70 << 100); QTest::newRow("InQuint") << int(QEasingCurve::InQuint) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 0 << 1 << 7 << 32 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 0 << 0 << 0 << 1 << 3 << 7 << 16 << 32 << 59 << 100); QTest::newRow("OutQuint") << int(QEasingCurve::OutQuint) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 67 << 92 << 98 << 99 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 40 << 67 << 83 << 92 << 96 << 98 << 99 << 99 << 99 << 100); QTest::newRow("InOutQuint") << int(QEasingCurve::InOutQuint) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 0 << 16 << 83 << 99 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 0 << 0 << 3 << 16 << 50 << 83 << 96 << 99 << 99 << 100); QTest::newRow("OutInQuint") << int(QEasingCurve::OutInQuint) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 46 << 49 << 50 << 53 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 33 << 46 << 49 << 49 << 50 << 50 << 50 << 53 << 66 << 100); QTest::newRow("InSine") << int(QEasingCurve::InSine) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 4 << 19 << 41 << 69 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 1 << 4 << 10 << 19 << 29 << 41 << 54 << 69 << 84 << 100); QTest::newRow("OutSine") << int(QEasingCurve::OutSine) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 30 << 58 << 80 << 95 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 15 << 30 << 45 << 58 << 70 << 80 << 89 << 95 << 98 << 100); QTest::newRow("InOutSine") << int(QEasingCurve::InOutSine) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 9 << 34 << 65 << 90 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 2 << 9 << 20 << 34 << 49 << 65 << 79 << 90 << 97 << 100); QTest::newRow("OutInSine") << int(QEasingCurve::OutInSine) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 29 << 47 << 52 << 70 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 15 << 29 << 40 << 47 << 50 << 52 << 59 << 70 << 84 << 100); QTest::newRow("InExpo") << int(QEasingCurve::InExpo) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 0 << 1 << 6 << 24 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 0 << 0 << 0 << 1 << 3 << 6 << 12 << 24 << 49 << 100); QTest::newRow("OutExpo") << int(QEasingCurve::OutExpo) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 75 << 93 << 98 << 99 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 50 << 75 << 87 << 93 << 96 << 98 << 99 << 99 << 99 << 100); QTest::newRow("InOutExpo") << int(QEasingCurve::InOutExpo) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 0 << 12 << 87 << 99 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 0 << 0 << 3 << 12 << 50 << 87 << 96 << 99 << 99 << 100); QTest::newRow("OutInExpo") << int(QEasingCurve::OutInExpo) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 46 << 49 << 50 << 53 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 37 << 46 << 49 << 49 << 50 << 50 << 50 << 53 << 62 << 100); QTest::newRow("InCirc") << int(QEasingCurve::InCirc) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 2 << 8 << 19 << 40 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 0 << 2 << 4 << 8 << 13 << 19 << 28 << 40 << 56 << 100); QTest::newRow("OutCirc") << int(QEasingCurve::OutCirc) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 59 << 80 << 91 << 97 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 43 << 59 << 71 << 80 << 86 << 91 << 95 << 97 << 99 << 100); QTest::newRow("InOutCirc") << int(QEasingCurve::InOutCirc) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 4 << 20 << 80 << 95 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 1 << 4 << 9 << 20 << 50 << 80 << 89 << 95 << 98 << 100); QTest::newRow("OutInCirc") << int(QEasingCurve::OutInCirc) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 40 << 48 << 51 << 60 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 29 << 40 << 45 << 48 << 50 << 51 << 54 << 60 << 70 << 100); QTest::newRow("InElastic") << int(QEasingCurve::InElastic) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 0 << 1 << -3 << -12 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 0 << 0 << 0 << 1 << -1 << -3 << 12 << -12 << -25 << 100); QTest::newRow("OutElastic") << int(QEasingCurve::OutElastic) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 112 << 103 << 98 << 100 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 125 << 112 << 87 << 103 << 101 << 98 << 100 << 100 << 99 << 100); QTest::newRow("InOutElastic") << int(QEasingCurve::InOutElastic) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 0 << -6 << 106 << 99 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 0 << 0 << -1 << -6 << 50 << 106 << 101 << 99 << 100 << 100); QTest::newRow("OutInElastic") << int(QEasingCurve::OutInElastic) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 56 << 49 << 49 << 53 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 37 << 56 << 49 << 49 << 50 << 49 << 50 << 53 << 24 << 100); QTest::newRow("InBack") << int(QEasingCurve::InBack) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << -4 << -9 << -2 << 29 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << -1 << -4 << -8 << -9 << -8 << -2 << 9 << 29 << 59 << 100); QTest::newRow("OutBack") << int(QEasingCurve::OutBack) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 70 << 102 << 109 << 104 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 40 << 70 << 90 << 102 << 108 << 109 << 108 << 104 << 101 << 100); QTest::newRow("InOutBack") << int(QEasingCurve::InOutBack) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << -9 << 8 << 91 << 109 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << -3 << -9 << -7 << 8 << 50 << 91 << 107 << 109 << 103 << 100); QTest::newRow("OutInBack") << int(QEasingCurve::OutInBack) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 51 << 52 << 47 << 48 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 35 << 51 << 54 << 52 << 50 << 47 << 45 << 48 << 64 << 100); QTest::newRow("InBounce") << int(QEasingCurve::InBounce) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 6 << 22 << 8 << 69 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 1 << 6 << 6 << 22 << 23 << 9 << 31 << 69 << 92 << 100); QTest::newRow("OutBounce") << int(QEasingCurve::OutBounce) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 30 << 91 << 77 << 93 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 7 << 30 << 68 << 90 << 76 << 77 << 93 << 94 << 98 << 100); QTest::newRow("InOutBounce") << int(QEasingCurve::InOutBounce) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 11 << 34 << 65 << 88 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 3 << 11 << 4 << 34 << 50 << 65 << 95 << 88 << 97 << 100); QTest::newRow("OutInBounce") << int(QEasingCurve::OutInBounce) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 41 << 43 << 56 << 58 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 15 << 40 << 27 << 43 << 50 << 56 << 72 << 58 << 84 << 100); QTest::newRow("InCurve") << int(QEasingCurve::InCurve) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 10 << 37 << 60 << 80 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 2 << 10 << 23 << 37 << 50 << 60 << 70 << 80 << 90 << 100); QTest::newRow("OutCurve") << int(QEasingCurve::OutCurve) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 20 << 39 << 62 << 89 << 100); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 10 << 20 << 30 << 39 << 50 << 62 << 76 << 89 << 97 << 100); QTest::newRow("SineCurve") << int(QEasingCurve::SineCurve) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 0 << 34 << 90 << 90 << 34 << 0); + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 0 << 9 << 34 << 65 << 90 << 100 << 90 << 65 << 34 << 9 << 0); QTest::newRow("CosineCurve") << int(QEasingCurve::CosineCurve) - << (IntList() << 0 << 20 << 40 << 60 << 80 << 100) - << (IntList() << 50 << 97 << 79 << 20 << 2 << 49); - + << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) + << (IntList() << 50 << 79 << 97 << 97 << 79 << 50 << 20 << 2 << 2 << 20 << 49); } @@ -387,7 +386,7 @@ void tst_QEasingCurve::valueForProgress() QString strInputs; QString strOutputs; - for (int t = 0; t <= 100; t+= 20) { + for (int t = 0; t <= 100; t+= 10) { qreal ease = curve.valueForProgress(t/qreal(100)); strInputs += QString::fromAscii(" << %1").arg(t); strOutputs += QString::fromAscii(" << %1").arg(int(100*ease)); -- cgit v0.12 From 435acb8edc48c0e13606a27392d4dc72952b19ca Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 24 Apr 2009 09:49:49 +1000 Subject: Expose basic BlendedImage docs. --- doc/src/declarative/elements.qdoc | 2 ++ src/declarative/fx/qfxblendedimage.cpp | 29 +++++++++++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc index afc3726..90a65c1 100644 --- a/doc/src/declarative/elements.qdoc +++ b/doc/src/declarative/elements.qdoc @@ -32,6 +32,7 @@ The following table lists the Qml elements provided by the Qt Declarative module \o \l SequentialAnimation \o \l ParallelAnimation \o \l SetPropertyAction +\o \l ParentChangeAction \o \l Transition \o \l Behaviour \o \l Follow @@ -67,6 +68,7 @@ The following table lists the Qml elements provided by the Qt Declarative module \o \l MouseRegion \o \l KeyActions \o \l AnimatedImage +\o \l BlendedImage \endlist \o diff --git a/src/declarative/fx/qfxblendedimage.cpp b/src/declarative/fx/qfxblendedimage.cpp index 9a3bb72..b5d9a9a 100644 --- a/src/declarative/fx/qfxblendedimage.cpp +++ b/src/declarative/fx/qfxblendedimage.cpp @@ -49,12 +49,24 @@ QT_BEGIN_NAMESPACE /*! + \qmlclass BlendedImage + \brief The BlendedImage elements blends two different images depending on a blend ratio. + + This element can be used to simulate blur on slow devices by setting secondaryUrl with + a pre-rendered blurred version of primaryUrl. + + Note that this class will only work under OpenGL. On the software canvas it will display + only the primary image unless the blend is > 0.75, in which case it will display only the + secondary image. +*/ + +/*! \internal \class QFxBlendedImage \brief The QFxBlendedImage blends two different images depending on a blend ratio. - This class can be used to simulate blur on slow devices by setting secondaryFile with - a pre-rendered blurred version of primaryFile. + This class can be used to simulate blur on slow devices by setting secondaryUrl with + a pre-rendered blurred version of primaryUrl. Note that this class will only work under OpenGL. On the software canvas it will display only the primary image unless the blend is > 0.75, in which case it will display only the @@ -69,8 +81,8 @@ QFxBlendedImage::QFxBlendedImage(QFxItem *parent) } /*! - \property QFxBlendedImage::primaryUrl - \brief the URL of the first image to be displayed in this item. + \qmlproperty string BlendedImage::primaryUrl + The URL of the first image to be displayed in this item. */ QString QFxBlendedImage::primaryUrl() const { @@ -97,8 +109,8 @@ void QFxBlendedImage::setPrimaryUrl(const QString &url) } /*! - \property QFxBlendedImage::secondaryUrl - \brief the URL of the second image to be displayed in this item. + \qmlproperty string BlendedImage::secondaryUrl + The URL of the second image to be displayed in this item. */ QString QFxBlendedImage::secondaryUrl() const { @@ -125,8 +137,8 @@ void QFxBlendedImage::setSecondaryUrl(const QString &url) } /*! - \property QFxBlendedImage::blend - \brief the ratio used to blend the two images. + \qmlproperty real BlendedImage::blend + The ratio used to blend the two images. If blend has a value of 0, only the first image will be displayed. If blend has a value of 1, only the second image will be displayed. @@ -246,4 +258,5 @@ void QFxBlendedImage::paintGLContents(GLPainter &p) #endif QML_DEFINE_TYPE(QFxBlendedImage,BlendedImage); + QT_END_NAMESPACE -- cgit v0.12 From c0979cc534e9204edc04759b7b6bef7d6980c466 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 24 Apr 2009 10:13:14 +1000 Subject: Don't access internal QMetaProperty members We can use the new QMetaProperty::propertyIndex() method instead. --- src/declarative/qml/qmlengine.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 63f45b4..b42480d 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -39,11 +39,7 @@ ** ****************************************************************************/ -// XXX ;) -#define private public #include -#undef private - #include #include @@ -308,7 +304,7 @@ bool QmlEnginePrivate::fetchCache(QmlBasicScriptNodeCache &cache, const QString cache.object = obj; cache.type = QmlBasicScriptNodeCache::Core; - cache.core = prop.property().idx + prop.property().mobj->propertyOffset(); + cache.core = prop.property().propertyIndex(); cache.coreType = prop.propertyType(); return true; -- cgit v0.12 From 728e1e1c3678768aafeb07ebe8e17dd2fbf047b2 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 24 Apr 2009 11:09:39 +1000 Subject: Don't manually stack children on GraphicsView GraphicsView now has a sane default stacking order. --- src/declarative/canvas/qsimplecanvasitem.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/declarative/canvas/qsimplecanvasitem.cpp b/src/declarative/canvas/qsimplecanvasitem.cpp index 5e4b5fa..7d9f61c 100644 --- a/src/declarative/canvas/qsimplecanvasitem.cpp +++ b/src/declarative/canvas/qsimplecanvasitem.cpp @@ -626,12 +626,8 @@ void QSimpleCanvasItem::addChild(QSimpleCanvasItem *c) { Q_D(QSimpleCanvasItem); d->children.append(c); - if(d->graphicsItem) { - // XXX - GraphicsView does not preserve the stacking order of items - c->setZ(d->children.count()); - } else { + if(!d->graphicsItem) d->needsZOrder = true; - } childrenChanged(); } -- cgit v0.12 From 19a507c5cc8c178a0e00fa302f6315c4b18b50a5 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 24 Apr 2009 11:18:54 +1000 Subject: Ensure -ve z stacks behind parent when using GraphicsView --- src/declarative/canvas/qsimplecanvasitem.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/declarative/canvas/qsimplecanvasitem.cpp b/src/declarative/canvas/qsimplecanvasitem.cpp index 7d9f61c..95f7623 100644 --- a/src/declarative/canvas/qsimplecanvasitem.cpp +++ b/src/declarative/canvas/qsimplecanvasitem.cpp @@ -443,7 +443,16 @@ void QSimpleCanvasItem::setZ(qreal z) return; if(d->graphicsItem) { + + if(z < 0) + d->graphicsItem->setFlag(QGraphicsItem::ItemStacksBehindParent, + true); + else + d->graphicsItem->setFlag(QGraphicsItem::ItemStacksBehindParent, + false); + d->graphicsItem->setZValue(z); + } else { if(d->data()->z == z) return; -- cgit v0.12 From 4001e0caa232f4c0624c28710c954e78264f4d7d Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 24 Apr 2009 11:47:38 +1000 Subject: Documentation fixes. Reduce the number of warnings from qdoc. \todo's have been made into tasks instead. --- doc/src/declarative/anchor-layout.qdoc | 2 +- doc/src/declarative/animation.qdoc | 2 +- doc/src/declarative/basictypes.qdoc | 2 +- doc/src/declarative/effects.qdoc | 2 +- doc/src/declarative/qmlforcpp.qdoc | 2 +- doc/src/declarative/tutorial1.qdoc | 4 ++-- src/declarative/extra/qmlnumberformatter.cpp | 1 + src/declarative/fx/qfxitem.cpp | 25 +++---------------------- src/declarative/fx/qfxitem.h | 4 ---- src/declarative/fx/qfxpainted.cpp | 10 +++++----- src/declarative/fx/qfxparticles.cpp | 2 +- src/declarative/fx/qfxrect.cpp | 5 +---- src/declarative/fx/qfxreflectionfilter.cpp | 3 --- src/declarative/fx/qfxrepeater.cpp | 8 +------- src/declarative/fx/qfxtext.cpp | 2 -- src/declarative/fx/qfxtextedit.cpp | 4 ++-- src/declarative/fx/qfxtransform.cpp | 5 ----- src/declarative/fx/qfxwidgetcontainer.cpp | 2 +- src/declarative/qml/qmlengine.cpp | 10 +++++----- src/declarative/util/qbindablemap.cpp | 3 +++ 20 files changed, 30 insertions(+), 68 deletions(-) diff --git a/doc/src/declarative/anchor-layout.qdoc b/doc/src/declarative/anchor-layout.qdoc index 9647a72..2b1f081 100644 --- a/doc/src/declarative/anchor-layout.qdoc +++ b/doc/src/declarative/anchor-layout.qdoc @@ -3,7 +3,7 @@ \target anchor-layout \title Anchor-based Layout -In additional to the more traditional Fx layouts \l {xmlGridLayout}{GridLayout}, \l {xmlHorizontalLayout}{HorizontalLayout}, and \l {xmlVerticalLayout}{VerticalLayout}, QML also provides a way to layout items using the concept of anchors. Each visual Fx item can be thought of as having a set of 6 invisible "anchor lines": \e left, \e horizontalCenter, \e right, \e top, \e verticalCenter, and \e bottom. +In additional to the more traditional Fx layouts GridLayout, HorizontalLayout, and VerticalLayout, QML also provides a way to layout items using the concept of anchors. Each visual Fx item can be thought of as having a set of 6 invisible "anchor lines": \e left, \e horizontalCenter, \e right, \e top, \e verticalCenter, and \e bottom. \image edges_qml.png diff --git a/doc/src/declarative/animation.qdoc b/doc/src/declarative/animation.qdoc index a1ab44b..a143d4c 100644 --- a/doc/src/declarative/animation.qdoc +++ b/doc/src/declarative/animation.qdoc @@ -126,5 +126,5 @@ Transitions can happen in parallel, in sequence, or in any combination of the tw \section1 Property Behaviors -\todo Document. Should we remove property behaviour altogether? +\note Property behaviors are currently experimental. */ diff --git a/doc/src/declarative/basictypes.qdoc b/doc/src/declarative/basictypes.qdoc index d6dae77..a6b9177 100644 --- a/doc/src/declarative/basictypes.qdoc +++ b/doc/src/declarative/basictypes.qdoc @@ -367,7 +367,7 @@ types. When used from QML, the engine automatically appends each value to the list. - For example, the \l {xmlItem}{Item} class has a children list property + For example, the \l Item class has a children list property that can be used like this: \code diff --git a/doc/src/declarative/effects.qdoc b/doc/src/declarative/effects.qdoc index c7cd2f6..e3c68bd 100644 --- a/doc/src/declarative/effects.qdoc +++ b/doc/src/declarative/effects.qdoc @@ -24,7 +24,7 @@ backends may be added if the performance can be made acceptable. \o \l Shadow \o \l Blur \o \l Reflection -\o \l Highlights +\o \l Highlight \o \l Particles \endlist diff --git a/doc/src/declarative/qmlforcpp.qdoc b/doc/src/declarative/qmlforcpp.qdoc index 7aa2560..f0675fe 100644 --- a/doc/src/declarative/qmlforcpp.qdoc +++ b/doc/src/declarative/qmlforcpp.qdoc @@ -545,7 +545,7 @@ "signal properties", using the name "on" where the first character of the signal's name is uppercased. If more than one signal of the same name is exist on a class, only the first is available (see the - \l {xmlConnection}{} element for more general signal connections). + \l Connection element for more general signal connections). An important observation to make here is the lack of braces. While both property bindings and signal properties involve executing ECMAScript code, diff --git a/doc/src/declarative/tutorial1.qdoc b/doc/src/declarative/tutorial1.qdoc index 15edaff..caadbf5 100644 --- a/doc/src/declarative/tutorial1.qdoc +++ b/doc/src/declarative/tutorial1.qdoc @@ -23,9 +23,9 @@ Here is the QML code for the application: \endcode -First, we declare a root element of type \l {xmlRect}{Rect}. It is one of the basic building blocks you can use to create an application in QML. +First, we declare a root element of type \l Rect. It is one of the basic building blocks you can use to create an application in QML. We give it an id to be able to refer to it later. In this case, we call it \e Page. We also set the \c width, \c height and \c color properties. -The \l {xmlRect}{Rect} element contains many other properties (such as \c x and \c y), but these are left at their default values. +The \l Rect element contains many other properties (such as \c x and \c y), but these are left at their default values. \section2 Text element diff --git a/src/declarative/extra/qmlnumberformatter.cpp b/src/declarative/extra/qmlnumberformatter.cpp index 60b154d..8772305 100644 --- a/src/declarative/extra/qmlnumberformatter.cpp +++ b/src/declarative/extra/qmlnumberformatter.cpp @@ -78,6 +78,7 @@ public: */ /*! + \internal \class QmlNumberFormatter \ingroup group_utility \brief The QmlNumberFormatter class allows you to format a number to a particular string format/locale specific number format. diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index ed65b84..9131256 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -838,23 +838,6 @@ void QFxItem::qmlLoaded() } /*! - \qmlproperty Item Item::clipToItem - - Experimental clip to item support. Do not use. - - \todo complete clip to item support. - */ -QFxItem *QFxItem::clipToItem() const -{ - return 0; -} - -void QFxItem::setClipToItem(QFxItem *) -{ - qWarning() << "QFxItem: clipToItem not implemented"; -} - -/*! \qmlproperty real Item::x \qmlproperty real Item::y \qmlproperty int Item::width @@ -1361,7 +1344,7 @@ void QFxItem::setScale(qreal s) Opacity is an \e inherited attribute. That is, the opacity is also applied individually to child items. In almost all cases this is what you want. If you can spot the issue in the following - example, you might need to use an opacity filter instead. + example, you might need to use an opacity filter (not yet available) instead. \table \row @@ -1385,8 +1368,6 @@ void QFxItem::setScale(qreal s) \endqml \endtable - - \todo There is no such thing as an opacity filter */ qreal QFxItem::opacity() const @@ -1488,8 +1469,8 @@ QmlList* QFxItem::transitions() \qmlproperty list Item::filter This property holds a list of graphical filters to be applied to the item. - \l {qmlfilter}{Filters} include things like \l {qmlblur}{blurring} - the item, or giving it a Reflection. Some + \l {Filter}{Filters} include things like \l {Blur}{blurring} + the item, or giving it a \l Reflection. Some filters may not be available on all canvases; if a filter is not available on a certain canvas, it will simply not be applied for that canvas (but the XML will still be considered valid). diff --git a/src/declarative/fx/qfxitem.h b/src/declarative/fx/qfxitem.h index d3b9899..c47a1e1 100644 --- a/src/declarative/fx/qfxitem.h +++ b/src/declarative/fx/qfxitem.h @@ -113,7 +113,6 @@ class Q_DECLARATIVE_EXPORT QFxItem : public QSimpleCanvasItem, public QmlParserS Q_PROPERTY(QString state READ state WRITE setState NOTIFY stateChanged) Q_PROPERTY(QString qml READ qml WRITE setQml NOTIFY qmlChanged) Q_PROPERTY(QFxItem *qmlItem READ qmlItem NOTIFY qmlChanged) - Q_PROPERTY(QFxItem *clipToItem READ clipToItem WRITE setClipToItem) Q_PROPERTY(qreal x READ x WRITE setX NOTIFY leftChanged) Q_PROPERTY(qreal y READ y WRITE setY NOTIFY topChanged) Q_PROPERTY(qreal z READ z WRITE setZ) @@ -174,9 +173,6 @@ public: QString qml() const; void setQml(const QString &); - QFxItem *clipToItem() const; - void setClipToItem(QFxItem *i); - bool flipVertically() const; void setFlipVertically(bool); bool flipHorizontally() const; diff --git a/src/declarative/fx/qfxpainted.cpp b/src/declarative/fx/qfxpainted.cpp index 8109efa..ad1b3ad 100644 --- a/src/declarative/fx/qfxpainted.cpp +++ b/src/declarative/fx/qfxpainted.cpp @@ -77,13 +77,12 @@ QT_BEGIN_NAMESPACE */ /*! - Constructs the painted item. + Constructs a painted item with parent object \a parent. */ - -//### what options do we need to set? QFxPainted::QFxPainted(QFxItem *parent) : QFxItem(*(new QFxPaintedPrivate), parent) { + //### what options do we need to set? setOptions(HasContents, true); } @@ -105,8 +104,9 @@ QFxPainted::QFxPainted(QFxPaintedPrivate &dd, QFxItem *parent) /*! \fn QFxPainted::paint(QPainter *painter) - Implement this method to paint the item. The painting will be cached and - paint() will only be called again if \l markDirty() has been called. + Implement this method to paint the item using \a painter. + The painting will be cached and paint() will only be called again + if \l markDirty() has been called. \sa markDirty() */ diff --git a/src/declarative/fx/qfxparticles.cpp b/src/declarative/fx/qfxparticles.cpp index 939afba..9319c46 100644 --- a/src/declarative/fx/qfxparticles.cpp +++ b/src/declarative/fx/qfxparticles.cpp @@ -917,7 +917,7 @@ void QFxParticles::setStreamIn(bool b) will be produced until it is set to true. */ /*! - \property bool Particles::emitting + \property QFxParticles::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. diff --git a/src/declarative/fx/qfxrect.cpp b/src/declarative/fx/qfxrect.cpp index 2e84c74..a761ec5 100644 --- a/src/declarative/fx/qfxrect.cpp +++ b/src/declarative/fx/qfxrect.cpp @@ -70,10 +70,7 @@ QML_DEFINE_TYPE(QFxPen,Pen); \brief the color of the pen. color is most commonly specified in hexidecimal notation (#RRGGBB) - or as an - \htmlonly - SVG color keyword name - \endhtmlonly + or as an \l {http://www.w3.org/TR/SVG/types.html#ColorKeywords}{SVG color keyword name} (as defined by the World Wide Web Consortium). For example: \code diff --git a/src/declarative/fx/qfxreflectionfilter.cpp b/src/declarative/fx/qfxreflectionfilter.cpp index d67095b..39342d7 100644 --- a/src/declarative/fx/qfxreflectionfilter.cpp +++ b/src/declarative/fx/qfxreflectionfilter.cpp @@ -103,9 +103,6 @@ public: Reflection is only supported when Qt Declarative is compiled for OpenGL ES 2.0. Otherwise the Reflection filter has no effect. - - \todo describe (and fix) reflection and bounding box interaction - */ /*! diff --git a/src/declarative/fx/qfxrepeater.cpp b/src/declarative/fx/qfxrepeater.cpp index ec1d88c..570d54d 100644 --- a/src/declarative/fx/qfxrepeater.cpp +++ b/src/declarative/fx/qfxrepeater.cpp @@ -110,13 +110,7 @@ QML_DEFINE_TYPE(QFxRepeater,Repeater); The repeater instance continues to own all items it instantiates, even if they are otherwise manipulated. It is illegal to manually remove an item - created by the Repeater. - - \todo Repeater is very conservative in how it instatiates/deletes items. - Also new model entries will not be created and old ones will not be removed. - - \todo Need an example - + created by the Repeater. */ /*! diff --git a/src/declarative/fx/qfxtext.cpp b/src/declarative/fx/qfxtext.cpp index bc03d7c..e7085d8 100644 --- a/src/declarative/fx/qfxtext.cpp +++ b/src/declarative/fx/qfxtext.cpp @@ -85,8 +85,6 @@ QML_DEFINE_TYPE(QFxText,Text); plain text to a set width. Text provides read-only text. For editable text, see \l TextEdit. - - \todo explain details of auto-sizing */ /*! diff --git a/src/declarative/fx/qfxtextedit.cpp b/src/declarative/fx/qfxtextedit.cpp index 96ebe0d..7efb826 100644 --- a/src/declarative/fx/qfxtextedit.cpp +++ b/src/declarative/fx/qfxtextedit.cpp @@ -294,7 +294,7 @@ void QFxTextEdit::setColor(const QColor &color) */ /*! - \property QFxText::hAlign + \property QFxTextEdit::hAlign \brief the horizontal alignment of the text. Valid values are \c AlignLeft, \c AlignRight, and \c AlignHCenter. The default value is \c AlignLeft. @@ -316,7 +316,7 @@ void QFxTextEdit::setHAlign(QFxTextEdit::HAlignment alignment) } /*! - \property QFxText::vAlign + \property QFxTextEdit::vAlign \brief the vertical alignment of the text. Valid values are \c AlignTop, \c AlignBottom, and \c AlignVCenter. The default value is \c AlignTop. diff --git a/src/declarative/fx/qfxtransform.cpp b/src/declarative/fx/qfxtransform.cpp index 90875a6..a001214 100644 --- a/src/declarative/fx/qfxtransform.cpp +++ b/src/declarative/fx/qfxtransform.cpp @@ -56,8 +56,6 @@ QML_DEFINE_TYPE(QFxTransform,Transform); /*! \qmlclass Transform \brief A transformation. - - \todo Document Transform. */ QFxTransform::QFxTransform(QObject *parent) : QObject(parent) @@ -334,9 +332,6 @@ public: \endcode \image flipable.gif - - \todo A lot needs to be done to get a fully-functioning Flipable. Should we simplify? - */ /*! diff --git a/src/declarative/fx/qfxwidgetcontainer.cpp b/src/declarative/fx/qfxwidgetcontainer.cpp index 44ccf0f..f86c8dc 100644 --- a/src/declarative/fx/qfxwidgetcontainer.cpp +++ b/src/declarative/fx/qfxwidgetcontainer.cpp @@ -73,7 +73,7 @@ QGraphicsWidget *QFxWidgetContainer::graphicsWidget() const } /*! - \property QGraphicsWidget QFxWidgetContainer::graphicsWidget + \qmlproperty QGraphicsWidget QFxWidgetContainer::graphicsWidget The QGraphicsWidget associated with this element. */ void QFxWidgetContainer::setGraphicsWidget(QGraphicsWidget *widget) diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 63f45b4..24570d5 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -465,7 +465,7 @@ QmlContext *QmlEngine::activeContext() /*! Sets the mappings from namespace URIs to URL to \a map. - \sa nameSpacePaths + \sa nameSpacePaths() */ void QmlEngine::setNameSpacePaths(const QMap& map) { @@ -476,7 +476,7 @@ void QmlEngine::setNameSpacePaths(const QMap& map) /*! Adds mappings (given by \a map) from namespace URIs to URL. - \sa nameSpacePaths + \sa nameSpacePaths() */ void QmlEngine::addNameSpacePaths(const QMap& map) { @@ -487,7 +487,7 @@ void QmlEngine::addNameSpacePaths(const QMap& map) /*! Adds a mapping from namespace URI \a ns to URL \a path. - \sa nameSpacePaths + \sa nameSpacePaths() */ void QmlEngine::addNameSpacePath(const QString& ns, const QString& path) { @@ -525,7 +525,7 @@ void QmlEngine::addNameSpacePath(const QString& ns, const QString& path) In the above case, "xyz://abc/def/Bar.qml" would then map to "file:///opt/jkl/def/Bar.qml". - \sa componentUrl + \sa componentUrl() */ QMap QmlEngine::nameSpacePaths() const { @@ -537,7 +537,7 @@ QMap QmlEngine::nameSpacePaths() const Returns the URL for the component source \a src, as mapped by the nameSpacePaths(), resolved relative to \a baseUrl. - \sa nameSpacePaths + \sa nameSpacePaths() */ QUrl QmlEngine::componentUrl(const QUrl& src, const QUrl& baseUrl) const { diff --git a/src/declarative/util/qbindablemap.cpp b/src/declarative/util/qbindablemap.cpp index aea2a2c..341dd31 100644 --- a/src/declarative/util/qbindablemap.cpp +++ b/src/declarative/util/qbindablemap.cpp @@ -117,6 +117,9 @@ QBindableMap::QBindableMap(QObject *parent) m_mo = new QBindableMapMetaObject(this); } +/*! + Destroys the bindable map. +*/ QBindableMap::~QBindableMap() { } -- cgit v0.12