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. [SOLVED] Transitions between screens
QtWS25 Last Chance

[SOLVED] Transitions between screens

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 4 Posters 8.8k 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.
  • B Offline
    B Offline
    borut123
    wrote on last edited by
    #1

    I'm developing Qt app which uses Qt/C++ (for fetching data from server, handling all the logic), and QML for GUI.

    How should I handle transitions between different qml screens?

    Currently I do it like this:
    QDeclarativeView *view = new QDeclarativeView;
    view->setSource(QUrl::fromLocalFile("screen1.qml"));
    view->show();

    And when another qml needs to be shown on the screen, I do it again:

    QDeclarativeView *view = new QDeclarativeView;
    view->setSource(QUrl::fromLocalFile("screen2.qml"));
    view->show();

    Is there any better way to handle transitions between screens?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alexander
      wrote on last edited by
      #2

      Maybe it will be better if you create one main qml screen which switches subscreens.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        borut123
        wrote on last edited by
        #3

        Could you please be more specific?

        1 Reply Last reply
        0
        • D Offline
          D Offline
          DenisKormalev
          wrote on last edited by
          #4

          What I've done at similar problem (but I need something that will work really flexible when user can change first qml, second qml and qml with transition).

          I created 3 QDeclarativeView's (for first screen, for second screen, for qml with transition beetwen screens)

          I added views with screens to transition view as children (through proxywidget)

          Started transition at transition view

          After transition completes I removed views with first screen and transition and left only view with second screen.

          If you can hardcode transition in your app you can use Animations Framework for it directly in c++ code.

          1 Reply Last reply
          0
          • 2 Offline
            2 Offline
            2beers
            wrote on last edited by
            #5

            Not sure if this helps but like alexander said you can use one screen with main.qml and you can switch screens from qml and not from C++. there are many ways to do this. one of them is to use "Loader":http://doc.qt.nokia.com/4.7/qml-loader.html

            Now depends of your program and what are you trying to do. if you want an animated transition between screens you can use "Transitions":http://doc.qt.nokia.com/4.7/qml-transition.html. at least this is how I did.

            1 Reply Last reply
            0
            • B Offline
              B Offline
              borut123
              wrote on last edited by
              #6

              thanks to all. I got the picture.

              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