Skip to content

Commit

Permalink
minimer v3
Browse files Browse the repository at this point in the history
  • Loading branch information
rburchell committed Jul 18, 2013
1 parent 3bc70bd commit cbc4111
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
4 changes: 3 additions & 1 deletion FPSMonitor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import QtQuick 2.0
Text {
property real t
property int frame: 0
color: "red"
text: "? Hz"

Timer {
id: fpsTimer
Expand All @@ -14,7 +16,7 @@ Text {
interval: 1000
running: true
onTriggered: {
console.log("FPS: " + fpsTimer.fps + " Hz")
parent.text = "FPS: " + fpsTimer.fps + " Hz"
fps = frame
frame = 0
}
Expand Down
35 changes: 31 additions & 4 deletions main.qml
Original file line number Diff line number Diff line change
@@ -1,17 +1,42 @@
import QtQuick 2.0

Item {
width: 320
height: 480
width: 480
height: 320

Image {
id: root
sourceSize.width: parent.width
sourceSize.height: parent.height
fillMode: Image.PreserveAspectCrop
// fillMode: Image.PreserveAspectCrop

Component.onCompleted: {
height = parent.height
width = parent.width
}

anchors.fill: parent
source: "wallpaper.jpg"

SequentialAnimation {
running: true
loops: Animation.Infinite

NumberAnimation {
target: root
property: "scale"
from: 0.5
to: 4.0
duration: 3000
}

NumberAnimation {
target: root
property: "scale"
from: 4.0
to: 0.5
duration: 1000
}
}
NumberAnimation on rotation {
id: rAnim
from: 0
Expand All @@ -22,5 +47,7 @@ Item {
}

FPSMonitor {
anchors.top: parent.top
anchors.left: parent.left
}
}

0 comments on commit cbc4111

Please sign in to comment.