Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Italian
  4. Effetto transizione universale
Qt 6.11 is out! See what's new in the release blog

Effetto transizione universale

Scheduled Pinned Locked Moved Unsolved Italian
1 Posts 1 Posters 458 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • PollyP Offline
    PollyP Offline
    Polly
    wrote on last edited by Polly
    #1

    Sto lavorando su un'applicazione turistica. In una schermata divisa in due colonne di due elementi ciascuna, inserisco 4 item come il seguente,

    import QtQuick 2.14
    
    Item {
        property alias posiX: rect.x
        property alias posiY: rect.y
        Rectangle
        {
            id:rect
            width: 50
            height: 50
            border.color: "black"
            border.width: 2
            state: "inizio"
    
            Loader
            {
                property bool running : false
                width:parent.width
                height: parent.height
                id:loaderpage1
    
            }
    
            MouseArea
            {
                anchors.fill: parent
                onClicked:
                {
                    switch(rect.state)
                    {
                    case"inizio":rect.state="fine";break
                    case"fine":rect.state="inizio";break
                    }
                }
            }
    
           // STATO BASATO SULLE DIMENSIONI
            states: [
                State {
                    name: "inizio"
                    PropertyChanges {
                        target: loaderpage1;
                        source:"";
    
                    }
                    PropertyChanges {
                        target: rect;
                        width:50;
                        height:50;
    
                    }
                },
                State {
                    name:"fine"
                    PropertyChanges {
                        target: loaderpage1;
                        source:"Video.qml";
    
                    }
                    PropertyChanges {
                        target: rect1;
                        width:wind.width;
                        height:wind.height;
                    }
                }
            ]
    
         transitions:
                [       Transition {
                    from: "inizio";to: "fine"
                    reversible: true
    
                    ParallelAnimation {
    
                        id:allargamento1
                        NumberAnimation { target: rect1; property: "width"; duration: 1000 }
                        NumberAnimation { target: rect1; property: "height"; duration: 1000 }
                        NumberAnimation { target: loaderpage1; property: "source"; duration: 1200 }
                    }
                }
    
            ]
        }
    
    }
    
    

    vorrei sapere nella schermata main dove inserisco questi oggetti, se posso aggiungere (e come fare) PropertyChanges agli Stati che ho definito e quindi un altre NumberAnimation se oltre al ridimensionamento vorrei modificare anche le posizioni x e y di qualcuno di questi oggetti

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved