**
****************************************************************************/
-import QtQuick 1.0
-import Qt.labs.particles 1.0
+import QtQuick 2.0
+import QtQuick.Particles 2.0
Item {
property bool explode : false
-
- Particles {
- id: particles
+ ParticleSystem {
width: 40
height: 40
- lifeSpan: 1000
- lifeSpanDeviation: 0
- source: "pics/star.png"
- count: 0
- angle: 270
- angleDeviation: 360
- velocity: 100
- velocityDeviation: 20
- z: 100
+ ImageParticle {
+ particles: ["star"]
+ source: "file:MinehuntCore/pics/star.png" // TODO: Use qrc path once QTBUG-21129 is fixed
+ }
+ Emitter {
+ id: particles
+ emitting: false
+ anchors.centerIn: parent
+ particle: "star"
+ speed: AngledDirection { angleVariation: 360; magnitude: 150; magnitudeVariation: 50 }
+ emitRate: 200
+ z: 100
+ lifeSpan: 1000
+ }
}
states: State { name: "exploding"; when: explode
- StateChangeScript {script: particles.burst(200); }
+ StateChangeScript { script: particles.burst(200); }
}
}
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 2.0
Flipable {
id: flipable
-Explosion 1.0 Explosion.qml
-Tile 1.0 Tile.qml
+Explosion 2.0 Explosion.qml
+Tile 2.0 Tile.qml
****************************************************************************/
#include <QtGui/QApplication>
-#include <QtQuick1/QDeclarativeView>
+#include <qsgview.h>
#include <QtDeclarative/QDeclarativeContext>
#include <QtDeclarative/QDeclarativeEngine>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
- QDeclarativeView canvas;
-
+ QSGView canvas;
+
qmlRegisterType<TileData>();
MinehuntGame* game = new MinehuntGame();
-
-#ifdef Q_OS_SYMBIAN
- canvas.setResizeMode(QDeclarativeView::SizeRootObjectToView);
-#endif
- canvas.engine()->rootContext()->setContextObject(game);
+
+ canvas.setResizeMode(QSGView::SizeRootObjectToView);
+ canvas.engine()->rootContext()->setContextObject(game);
canvas.setSource(QString("qrc:minehunt.qml"));
QObject::connect(canvas.engine(), SIGNAL(quit()), &app, SLOT(quit()));
-
-#ifdef Q_OS_SYMBIAN
- canvas.showFullScreen();
-#else
- canvas.setGeometry(QRect(100, 100, 450, 450));
+
canvas.show();
-#endif
return app.exec();
}
TEMPLATE = app
TARGET = minehunt
-QT += declarative qtquick1
+QT += declarative
# Input
HEADERS += minehunt.h
SOURCES += main.cpp minehunt.cpp
RESOURCES = minehunt.qrc
-
-sources.files = minehunt.qml minehunt.pro MinehuntCore
-sources.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/declarative/minehunt
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/declarative/minehunt
-
-INSTALLS = sources target
-
-symbian:{
- TARGET.EPOCALLOWDLLDATA = 1
- TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
- CONFIG += qt_example
- qmlminehuntfiles.files = MinehuntCore minehunt.qml
- DEPLOYMENT += qmlminehuntfiles
-}
-
**
****************************************************************************/
-import QtQuick 1.0
-import "MinehuntCore" 1.0
+import QtQuick 2.0
+import "MinehuntCore" 2.0
Item {
id: field
+++ /dev/null
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-//![0]
-Package {
- Text { id: listDelegate; width: 200; height: 25; text: 'Empty'; Package.name: 'list' }
- Text { id: gridDelegate; width: 100; height: 50; text: 'Empty'; Package.name: 'grid' }
-
- Rectangle {
- id: wrapper
- width: 200; height: 25
- color: 'lightsteelblue'
-
- Text { text: display; anchors.centerIn: parent }
- MouseArea {
- anchors.fill: parent
- onClicked: {
- if (wrapper.state == 'inList')
- wrapper.state = 'inGrid';
- else
- wrapper.state = 'inList';
- }
- }
-
- state: 'inList'
- states: [
- State {
- name: 'inList'
- ParentChange { target: wrapper; parent: listDelegate }
- },
- State {
- name: 'inGrid'
- ParentChange {
- target: wrapper; parent: gridDelegate
- x: 0; y: 0; width: gridDelegate.width; height: gridDelegate.height
- }
- }
- ]
-
- transitions: [
- Transition {
- ParentAnimation {
- NumberAnimation { properties: 'x,y,width,height'; duration: 300 }
- }
- }
- ]
- }
-}
-//![0]
+++ /dev/null
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Rectangle {
- color: "white"
- width: 400
- height: 200
-
- ListModel {
- id: myModel
- ListElement { display: "One" }
- ListElement { display: "Two" }
- ListElement { display: "Three" }
- ListElement { display: "Four" }
- ListElement { display: "Five" }
- ListElement { display: "Six" }
- ListElement { display: "Seven" }
- ListElement { display: "Eight" }
- }
- //![0]
- VisualDataModel {
- id: visualModel
- delegate: Delegate {}
- model: myModel
- }
-
- ListView {
- width: 200; height:200
- model: visualModel.parts.list
- }
- GridView {
- x: 200; width: 200; height:200
- cellHeight: 50
- model: visualModel.parts.grid
- }
- //![0]
-}
TEMPLATE = app
-
-QT += declarative qtquick1
-
-RESOURCES += abstractitemmodel.qrc
+TARGET = abstractitemmodel
+DEPENDPATH += .
+INCLUDEPATH += .
+QT += declarative
HEADERS = model.h
-SOURCES = main.cpp model.cpp
+SOURCES = main.cpp \
+ model.cpp
+RESOURCES += abstractitemmodel.qrc
\ No newline at end of file
**
****************************************************************************/
#include "model.h"
-#include <QtQuick1/QDeclarativeView>
-#include <QtDeclarative/QDeclarativeContext>
#include <QApplication>
+#include <qdeclarativeengine.h>
+#include <qdeclarativecontext.h>
+#include <qdeclarative.h>
+#include <qsgitem.h>
+#include <qsgview.h>
//![0]
int main(int argc, char ** argv)
model.addAnimal(Animal("Polar bear", "Large"));
model.addAnimal(Animal("Quoll", "Small"));
- QDeclarativeView view;
+ QSGView view;
+ view.setResizeMode(QSGView::SizeRootObjectToView);
QDeclarativeContext *ctxt = view.rootContext();
ctxt->setContextProperty("myModel", &model);
//![0]
** $QT_END_LICENSE$
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 2.0
//![0]
ListView {
width: 200; height: 250
- anchors.fill: parent
model: myModel
delegate: Text { text: "Animal: " + type + ", " + size }
HEADERS += dataobject.h
RESOURCES += objectlistmodel.qrc
-sources.files = $$SOURCES $$HEADERS $$RESOURCES objectlistmodel.pro view.qml
-sources.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/declarative/objectlistmodel
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/declarative/objectlistmodel
-
-INSTALLS += sources target
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 2.0
XmlListModel {
property string tags : ""
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 2.0
ListModel {
ListElement {
**
****************************************************************************/
-import QtQuick 1.1
+import QtQuick 2.0
Rectangle {
id: root
**
****************************************************************************/
-import QtQuick 1.1
+import QtQuick 2.0
Rectangle {
id: root
**
****************************************************************************/
-import QtQuick 1.1
+import QtQuick 2.0
Rectangle {
id: root
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 2.0
Rectangle {
id: container
**
****************************************************************************/
-import QtQuick 1.0
-import Qt.labs.particles 1.0
+import QtQuick 2.0
+import QtQuick.Particles 2.0
Item {
id: root
}
- Particles { id: particles
+ ParticleSystem {
width:1; height:1; anchors.centerIn: parent;
- emissionRate: 0;
- lifeSpan: 700; lifeSpanDeviation: 600;
- angle: 0; angleDeviation: 360;
- velocity: 100; velocityDeviation:30;
- source: "pics/yellowStar.png";
+ ImageParticle {
+ particles: ["star"]
+ source: "pics/yellowStar.png"
+ }
+ Emitter {
+ id: particles
+ anchors.fill: parent
+ particle: "star"
+ emitRate: 50
+ emitting: false
+ lifeSpan: 700
+ acceleration: AngledDirection { angleVariation: 360; magnitude: 200 }
+ }
}
states: [
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 2.0
// Models a high score table.
//
**
****************************************************************************/
-import QtQuick 1.0
-import Qt.labs.particles 1.0
+import QtQuick 2.0
+import QtQuick.Particles 2.0
Item { id:link
property bool dying: false
opacity: 0
}
-
- Particles { id: particles
+ ParticleSystem {
width:1; height:1; anchors.centerIn: parent;
- emissionRate: 0;
- lifeSpan: 700; lifeSpanDeviation: 600;
- angle: 0; angleDeviation: 360;
- velocity: 100; velocityDeviation:30;
- source: {
- if(type == 1){
- "pics/blueStar.png";
- } else {
- "pics/redStar.png";
- }
+ ImageParticle {
+ particles: ["star"]
+ source: type == 1 ? "pics/blueStar.png" : "pics/redStar.png"
+ }
+ Emitter {
+ id: particles
+ anchors.fill: parent
+ particle: "star"
+ emitRate: 50
+ emitting: false
+ lifeSpan: 700
+ acceleration: AngledDirection { angleVariation: 360; magnitude: 200 }
}
}
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 2.0
Image {
property bool spawned: false
var scheduledDirections = new Array;
var numRows = 1;
var numColumns = 1;
-var linkComponent = Qt.createComponent("content/Link.qml"); // XXX should resolve relative to script, not component
-var cookieComponent = Qt.createComponent("content/Cookie.qml");
+var linkComponent = Qt.createComponent("Link.qml");
+var cookieComponent = Qt.createComponent("Cookie.qml");
var cookie;
var linksToGrow = 0;
var linksToDie = 0;
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 2.0
import "content" as Content
import "content/snake.js" as Logic
Timer {
id: heartbeat;
interval: heartbeatInterval;
- running: activeGame && runtime.isActiveWindow
+ running: activeGame && Qt.application.active
repeat: true
onTriggered: { Logic.move() }
}
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: container
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 2.0
Component {
id: listDelegate
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 2.0
FocusScope {
id:container
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 2.0
Image {
id: loading; source: "images/loading.png"
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 2.0
Item {
TitleBar { id: titleBar; width: parent.width; height: 60;
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 2.0
Item { id: wrapper
property variant model: xmlModel
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 2.0
FocusScope {
id: wrapper
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: titleBar
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 2.0
Item {
id: toolbar
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 2.0
//This "model" gets the user information about the searched user. Mainly for the icon.
-SearchView 1.0 SearchView.qml
-Button 1.0 Button.qml
-Input 1.0 Input.qml
-FatDelegate 1.0 FatDelegate.qml
-Loading 1.0 Loading.qml
-MultiTitleBar 1.0 MultiTitleBar.qml
-TitleBar 1.0 TitleBar.qml
-RssModel 1.0 RssModel.qml
-UserModel 1.0 UserModel.qml
-ToolBar 1.0 ToolBar.qml
+SearchView 2.0 SearchView.qml
+Button 2.0 Button.qml
+Input 2.0 Input.qml
+FatDelegate 2.0 FatDelegate.qml
+Loading 2.0 Loading.qml
+MultiTitleBar 2.0 MultiTitleBar.qml
+TitleBar 2.0 TitleBar.qml
+RssModel 2.0 RssModel.qml
+UserModel 2.0 UserModel.qml
+ToolBar 2.0 ToolBar.qml
**
****************************************************************************/
-import QtQuick 1.0
-import "TwitterCore" 1.0 as Twitter
+import QtQuick 2.0
+import "TwitterCore" 2.0 as Twitter
Item {
id: screen; width: 320; height: 480