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. Flow of control in execution
Forum Updated to NodeBB v4.3 + New Features

Flow of control in execution

Scheduled Pinned Locked Moved Mobile and Embedded
22 Posts 4 Posters 10.6k 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.
  • G Offline
    G Offline
    giesbert
    wrote on last edited by
    #12

    Hi Revu,

    please, let's step back one step and look at the use case, ok?
    What do you want to achive. Let's make a suggestion:

    • You have a main window with a button
    • if the user clicks on the button, a sub main window opens
    • if the sub window is closed what should happen from the users point of view?
    • is the first main window usable while the second one is open? (is second one modal or non modal?)

    Nokia Certified Qt Specialist.
    Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

    1 Reply Last reply
    0
    • L Offline
      L Offline
      leon.anavi
      wrote on last edited by
      #13

      Hi Revu,

      Could you please explain what are you trying to achieve in general?

      If you want to have several views like in Symbian C++ you check this example:
      http://wiki.forum.nokia.com/index.php/Extending_QStackedWidget_for_sliding_page_animations_in_Qt

      Cheers,
      Leon

      http://anavi.org/

      1 Reply Last reply
      0
      • L Offline
        L Offline
        leon.anavi
        wrote on last edited by
        #14

        Sorry guys I posted a wrong link.

        Revu, please have a look at this discussion about multiple QMainWindow at Forum Nokia: http://discussion.forum.nokia.com/forum/showthread.php?195528-Multiple-QMainWindow-but-exit-on-one-window-exits-whole-application-in-Symbian

        http://anavi.org/

        1 Reply Last reply
        0
        • R Offline
          R Offline
          Revu
          wrote on last edited by
          #15

          @Andre:Thank you for that tip.

          @Gerolf:

          • You have a main window with a button - Yes
          • if the user clicks on the button, a sub main window opens - Yes
          • if the sub window is closed what should happen from the users point of view? - mainwindow should be visible.
          • is the first main window usable while the second one is open? (is second one modal or non modal?) - I had used modal window.How can I make it non modal?At the same time track the execution control?

          @Leon: When the sub window is closed,how is my mainwindow is notified?To be simple,if there is a message box on button click in my mainwindow then then how will the control be transferred from button to that message box and from message box to mainwindow?

          Edit: fixed formatting; Andre

          Every fall is to raise higher than Before.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            giesbert
            wrote on last edited by
            #16

            I think we should clarify some general points:

            a modal window means you have a local event loop running while the window is open. This is done by calling exec() on a dialog. For a top level window, I think you would have to do it on your own, by locking at the implementation of QDialog::exec().

            for example:

            @
            MyClass::foo()
            {
            YmDlg dlg;

            if(dlg.exec&#40;&#41;) // <-- this spins a local event loop only processing events for the dialog and sub widgets.
            {
            }
            

            }
            @

            exec() returns when the dialog is closed.

            if you have a main windows that you just show (non modal!) then the user could switch between the windows. If that is really possible depends on the system you are on and whether it supports window switching by the user (like with ALT+Tab on windows, I have no idea of your embedded system).

            If switching by the user is not possible, he can only handle the visible window. when you close it he can use the now visible window.

            Why do you want toi track execution control?
            The user uses the visible windows. If you need modal windows on top, make them modal. A non modal windows which ensures, other windows are not used makes itself model without being it. That makes it much more complicated.

            Nokia Certified Qt Specialist.
            Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

            1 Reply Last reply
            0
            • L Offline
              L Offline
              leon.anavi
              wrote on last edited by
              #17

              [quote author="Revu" date="1302582827"]
              @Leon: When the sub window is closed,how is my mainwindow is notified?To be simple,if there is a message box on button click in my mainwindow then then how will the control be transferred from button to that message box and from message box to mainwindow?

              Edit: fixed formatting; Andre
              [/quote]

              Hi Revu,

              You can handle the button click in your mainwindow and to show the message box.

              If you need more help please share some of your source code.

              [quote author="Gerolf" date="1302593674"]I think we should clarify some general points:
              Why do you want toi track execution control?
              [/quote]

              I am wondering why do want to track execution control, too. With Qt you have full control of all GUI components and you can show,hide,close,etc. them whenever you want.

              http://anavi.org/

              1 Reply Last reply
              0
              • R Offline
                R Offline
                Revu
                wrote on last edited by
                #18

                Hi Leon,
                Thank you for your response.I want to track the execution to know how exactly the control is getting transferred from one window to other.Is that the control of a window will be in its loop until it executes its slot?Can it be used while executing another slot of a different class?
                Any idea?

                Every fall is to raise higher than Before.

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  leon.anavi
                  wrote on last edited by
                  #19

                  [quote author="Revu" date="1302668965"]I want to track the execution to know how exactly the control is getting transferred from one window to other.[/quote]

                  If you need to track the execution so badly just follow Andre's advice and use a debugger.

                  http://anavi.org/

                  1 Reply Last reply
                  0
                  • R Offline
                    R Offline
                    Revu
                    wrote on last edited by
                    #20

                    I tried the debugger by setting the breakpoints.Thank You All.

                    Every fall is to raise higher than Before.

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      giesbert
                      wrote on last edited by
                      #21

                      There is no tracking of that, POINT.

                      There is a main event loop inside your main function. Everything is triggered by the event loop. If you have several main windows, all are handled by the same event loop. No separate handling for separate windows.

                      Modal windows spin their own modal event loop to block the main event loop during their display.

                      signals-slot connections (if they are direct) are direct function calls. Queued connections are synchronised via the event loop.

                      Nokia Certified Qt Specialist.
                      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                      1 Reply Last reply
                      0
                      • R Offline
                        R Offline
                        Revu
                        wrote on last edited by
                        #22

                        @Geroif:Thank You so much for making a clear understanding.

                        Every fall is to raise higher than Before.

                        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