Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Screen slide animation with states and transitions, setting a default transition
Qt 6.11 is out! See what's new in the release blog

Screen slide animation with states and transitions, setting a default transition

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 537 Views 1 Watching
  • 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.
  • R Offline
    R Offline
    RudolfVonKrugstein
    wrote on last edited by RudolfVonKrugstein
    #1

    Hey,

    I have an app with several screens, which each have an associated state. Now I want to have a slide animation between screens.

    It is actually not that difficult, I do it like this:

    states: [
        State {
            name: "start"
        },
        State {
            name: "login"
        }
    ]
    transitions: [
        SlideLeftTransition {
            from: "start"
            to: "login"
            inTarget: loginscreen
            outTarget: startscreen
        }
    ]
    

    SlideLeftTransition is the transition taking care of sliding the screens. Now if I have 10 screens, I would need to define 9+8+7+6+5+4+3+2+1=45 transitions.

    So I want to define a default transition!

    SlideLeftTransition {
            inTarget: screen_of_old_state
            outTarget: screen_of_new_state
        }
    

    But I am missing 2 ingridients:

    1. I have to associate a state with a screen, in a way that I can access the screen from a generic transition.
    2. I have to know from which state/screen I am coming.

    How can this be done?

    Thanks!

    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