User Tools

Site Tools


qt-quick-for-designers-1:components

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
qt-quick-for-designers-1:components [2013/06/22 04:24] – [Signals] mithatqt-quick-for-designers-1:components [2013/06/22 04:31] mithat
Line 125: Line 125:
 import QtQuick 1.0 import QtQuick 1.0
    
-import "randomFile.js" as RandomFunction 
- 
 Item { Item {
     id: myItem     id: myItem
     width: 400     width: 400
     height: 400     height: 400
- 
-    property int actualStateNumber: 0 
- 
-    Image { 
-        source: "images/background.png" 
-    } 
- 
-    Image { 
-        id: spaceship 
-        x: -200 
-        y: 50 
-        source: "images/spaceship.png" 
-    } 
  
     Button {     Button {
Line 153: Line 138:
  
         onButtonClicked:{         onButtonClicked:{
-            myItem.state RandomFunction.randomState();+            button.labelText="Hooray!";
         }         }
     }     }
- 
-   states: [ 
-         State { 
-             name: "bottomRight" 
-             PropertyChanges { 
-                 target: spaceship 
-                 x: 250 
-                 y: 200 
-             } 
-         }, 
-         State { 
-             name: "bottomLeft" 
-             PropertyChanges { 
-                 target: spaceship 
-                 x: 100 
-                 y: 200 
-             } 
-         }, 
-         State { 
-             name: "topLeft" 
-             PropertyChanges { 
-                 target: spaceship 
-                 x: 10 
-                 y: 50 
-             } 
-         }, 
-         State { 
-             name: "topRight" 
-             PropertyChanges { 
-                 target: spaceship 
-                 x: 100 
-                 y: 50 
-             } 
-         } 
-    ] 
- 
-    transitions: [ 
-         Transition { 
-             NumberAnimation { 
-                 properties: "x,y" 
-                 duration: 500 
-                 easing.type: Easing.OutExpo 
-             } 
-         }, 
-         Transition { 
-             from: "" 
-             to: "topLeft" 
-             SequentialAnimation{ 
-                PauseAnimation { 
-                     duration: 1000 
-                } 
- 
-                NumberAnimation { 
-                    properties: "x,y" 
-                    duration: 500 
-                    easing.type: Easing.OutExpo 
-                } 
-             } 
-         } 
-    ] 
- 
-    Component.onCompleted:{ 
-        myItem.state = "topLeft"; 
-    } 
- 
 } }
 </file> </file>
  
qt-quick-for-designers-1/components.txt · Last modified: 2013/07/06 22:53 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki