parent
e49b346e63
commit
828e0ba144
@ -0,0 +1,11 @@
|
||||
#include "myclass.h"
|
||||
#include <QApplication>
|
||||
|
||||
MyClass::MyClass(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void MyClass::aboutQt() {
|
||||
QApplication::aboutQt();
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
#ifndef MYCLASS_H
|
||||
#define MYCLASS_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class MyClass : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MyClass(QObject *parent = 0);
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
void aboutQt();
|
||||
};
|
||||
|
||||
#endif // MYCLASS_H
|
@ -0,0 +1,79 @@
|
||||
import QtQuick 2.2
|
||||
|
||||
Rectangle {
|
||||
id: tileContainer
|
||||
width: 425/4
|
||||
height: 425/4
|
||||
radius: 3
|
||||
color: "white"
|
||||
property string tileText: ""
|
||||
property int tileFontSize: 55
|
||||
property color tileColor: "black"
|
||||
property int moveAnimTime: 100
|
||||
property int newTileAnimTime: 200
|
||||
property bool runNewTileAnim: false
|
||||
property bool destroyFlag: false
|
||||
|
||||
Text {
|
||||
id: tileLabel
|
||||
text: tileText
|
||||
color: tileColor
|
||||
font.pixelSize: tileFontSize
|
||||
font.bold: true
|
||||
anchors.centerIn: parent
|
||||
Behavior on text {
|
||||
PropertyAnimation {
|
||||
duration: moveAnimTime
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ParallelAnimation {
|
||||
running: runNewTileAnim
|
||||
NumberAnimation {
|
||||
target: tileContainer
|
||||
property: "opacity"
|
||||
from: 0.0
|
||||
to: 1.0
|
||||
duration: newTileAnimTime
|
||||
}
|
||||
|
||||
ScaleAnimator {
|
||||
target: tileContainer
|
||||
from: 0
|
||||
to: 1
|
||||
duration: newTileAnimTime
|
||||
easing.type: Easing.OutQuad
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: moveAnimTime
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on y {
|
||||
NumberAnimation {
|
||||
easing.type: Easing.InQuad
|
||||
duration: moveAnimTime
|
||||
onRunningChanged: {
|
||||
if ((!running) && destroyFlag) {
|
||||
tileContainer.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on x {
|
||||
NumberAnimation {
|
||||
easing.type: Easing.InQuad
|
||||
duration: moveAnimTime
|
||||
onRunningChanged: {
|
||||
if ((!running) && destroyFlag) {
|
||||
tileContainer.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue