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 to queue events in QML?
Forum Updated to NodeBB v4.3 + New Features

Is it possible to queue events in QML?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 3 Posters 508 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.
  • R Offline
    R Offline
    RobM
    wrote on 3 Feb 2022, 16:54 last edited by RobM 2 Mar 2022, 16:56
    #1

    So I have a single button which is controlling the closing of multiple screens which are are technically available at the same time. The problem I am running into is having multiple screens open and layered on top of one another. For instance, the user clicks a button which will open a screen and display some details but while viewing this screen they still have the ability to open another on top of the one they are viewing but both screens need to use the same button in order to close.

    So, I am trying to figure out how to tell the close button that the user is attempting to close the screen they last opened rather than the first one? I thought perhaps if I could queue these "events" then the close button could simply de-queue the last event rather than closing a specific screen. Is there any queue type system in QML that I could use without using C++ if not than does anyone have an suggestions for how I could handle this?

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lemons
      wrote on 4 Feb 2022, 07:34 last edited by
      #2

      Maybe you take a took at Ben Laus Flux implementation for QML.
      This could meet your requirements and also offers a decent structure for growing applications.
      https://github.com/benlau/quickflux

      1 Reply Last reply
      0
      • R Offline
        R Offline
        RobM
        wrote on 4 Feb 2022, 22:36 last edited by
        #3

        I believe that a basic property var screenQueue: [] is going to work just fine. It won't be as verbose as a fully implemented queue but it will do the trick.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          GrecKo
          Qt Champions 2018
          wrote on 6 Feb 2022, 12:18 last edited by
          #4

          Or use StackView, push or replace pages onto it and pop them when needed.

          1 Reply Last reply
          0

          1/4

          3 Feb 2022, 16:54

          • Login

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