Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Is it possible in QML to smoothly open in a new window

Is it possible in QML to smoothly open in a new window

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 527 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.
  • M Offline
    M Offline
    Mikeeeeee
    wrote on last edited by
    #1

    Good afternoon.
    I read that you I can make an animated transition between the States of one window. But is it possible to make a smooth opening of another window, for example, to the window smoothly left from some side?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      Mikeeeeee
      wrote on last edited by
      #2
      import QtQuick 2.4
      import QtQuick.Window 2.0
      import QtQuick.Controls 2.5
       
      Window {
          id: window
          width: 400
          height: 400
          visible: true
       
          Loader {
              id: loader
              anchors.fill: parent
       
              onSourceChanged: animation.running = true
       
              NumberAnimation {
                  id: animation
                  target: loader.item
                  property: "x"
                  from: -width
                  to: 0
                  duration: 1000
                  easing.type: Easing.InExpo
              }
          }
       
          Button {
              anchors.horizontalCenter: parent.horizontalCenter
              anchors.bottom: parent.bottom
              anchors.bottomMargin: 5
       
              text: qsTr("Click me")
       
              onClicked: {
                  loader.source = "MyRectangle.qml"
              }
          }
      
      1 Reply Last reply
      1

      • Login

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