Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.0
- import Ubuntu.Components 0.1
- import "components"
- import QtMultimedia 5.0
- /*!
- \brief MainView with a Label and Button elements.
- */
- MainView {
- // objectName for functional testing purposes (autopilot-qt5)
- objectName: "mainView"
- // Note! applicationName needs to match the "name" field of the click manifest
- applicationName: "com.ubuntu.developer..salut"
- /*
- This property enables the application to change orientation
- when the device is rotated. The default is false.
- */
- //automaticOrientation: true
- width: units.gu(100)
- height: units.gu(75)
- Grid{
- columns: 2
- rows: 2
- columnSpacing: units.gu(2)
- rowSpacing: units.gu(2)
- UbuntuShape {
- Audio {
- id: sound
- source : "elephant.ogg"
- }
- MouseArea {
- anchors.fill: parent
- onPressed: {
- sound.play();
- }
- }
- radius: "medium"
- image: Image {
- source: "elephant.png"
- }
- }
- UbuntuShape {
- image: Image {
- source: "cat.png"
- }
- }
- UbuntuShape {
- image: Image {
- source: "cat.png"
- }
- }
- UbuntuShape {
- id : box
- radius: "medium"
- image: Image {
- source: "ubuntu_logo.png"
- }
- SequentialAnimation {
- id: animation
- RotationAnimation {
- target: box
- properties: "rotation"
- duration: 100
- to: 10
- easing.type: Easing.OutQuad
- }
- RotationAnimation {
- target: box
- properties: "rotation"
- duration: 200
- to: -10
- easing.type: Easing.OutQuad
- }
- }
- MouseArea {
- anchors.fill: parent
- onPressed: { animation.start();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement