Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to use state machine to avoid overlapping of 2 popup in qt ?
QtWS25 Last Chance

How to use state machine to avoid overlapping of 2 popup in qt ?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
8 Posts 4 Posters 725 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.
  • Q Offline
    Q Offline
    Qt embedded developer
    wrote on last edited by Qt embedded developer
    #1

    i have seen overlapping of ui screen and popup in my qt application.

    when in my current screen i opened popup at that time i given option to close the popup on click of ok button.

    now until user not click on ok button my popup will not get close. during same time if my embedded product click on shut down hardware button at same time shutting down popup will get open.

    so that both popup get overlapped due to this implementation. how to handle this situation using statemachine ?

    kshegunovK 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Do you mean handle both dialog at the same time ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      Q 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Do you mean handle both dialog at the same time ?

        Q Offline
        Q Offline
        Qt embedded developer
        wrote on last edited by
        #3

        @SGaist yes

        1] base ui class screen has several state. when first time we entering in screen one message box open which ask user to click on ok to close.

        now until user not click on ok . that message box remains there.

        2] now at same time from hardware switch pressed at same time one new popup with shutting down message comes.

        problem : this shutdown popup need to come on top of message box but this popup comes back side of popup.

        how to handle this situation so that shutdown popup comes above message box

        jsulmJ 1 Reply Last reply
        0
        • Q Qt embedded developer

          @SGaist yes

          1] base ui class screen has several state. when first time we entering in screen one message box open which ask user to click on ok to close.

          now until user not click on ok . that message box remains there.

          2] now at same time from hardware switch pressed at same time one new popup with shutting down message comes.

          problem : this shutdown popup need to come on top of message box but this popup comes back side of popup.

          how to handle this situation so that shutdown popup comes above message box

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Qt-embedded-developer Can't you close the first dialog before showing the second one?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          Q 1 Reply Last reply
          0
          • Q Qt embedded developer

            i have seen overlapping of ui screen and popup in my qt application.

            when in my current screen i opened popup at that time i given option to close the popup on click of ok button.

            now until user not click on ok button my popup will not get close. during same time if my embedded product click on shut down hardware button at same time shutting down popup will get open.

            so that both popup get overlapped due to this implementation. how to handle this situation using statemachine ?

            kshegunovK Offline
            kshegunovK Offline
            kshegunov
            Moderators
            wrote on last edited by
            #5

            Is this widgets or QML?

            Read and abide by the Qt Code of Conduct

            Q 1 Reply Last reply
            0
            • kshegunovK kshegunov

              Is this widgets or QML?

              Q Offline
              Q Offline
              Qt embedded developer
              wrote on last edited by
              #6

              @kshegunov widget

              kshegunovK 1 Reply Last reply
              0
              • Q Qt embedded developer

                @kshegunov widget

                kshegunovK Offline
                kshegunovK Offline
                kshegunov
                Moderators
                wrote on last edited by kshegunov
                #7

                It's rather rare one uses a state machine with the widgets, but anyway. The way to do it is the same as with QML. Define two states, one that is the main window shown, one that is the dialog shown. When the event arrives, transition between the states. Use the https://doc.qt.io/qt-5/qstate.html#assignProperty method to bind specific properties of the widgets to the states (e.g. the window visibility).

                Read and abide by the Qt Code of Conduct

                1 Reply Last reply
                2
                • jsulmJ jsulm

                  @Qt-embedded-developer Can't you close the first dialog before showing the second one?

                  Q Offline
                  Q Offline
                  Qt embedded developer
                  wrote on last edited by
                  #8

                  @jsulm No because its waiting for user to click on ok . and at same time due to shutdown button clicked the shutdown label came . this both situation need to show at same time

                  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