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. How to detect when user changes anything in MainWindow screen.
Forum Update on Monday, May 27th 2025

How to detect when user changes anything in MainWindow screen.

Scheduled Pinned Locked Moved General and Desktop
7 Posts 3 Posters 2.5k 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.
  • C Offline
    C Offline
    chooser
    wrote on 9 Aug 2013, 16:18 last edited by
    #1

    Hi wondering if anybody has a good solution for this problem I am trying to solve.

    I have a MainWindow with a bunch of child QDockWidgets, QMainMenu, and QToolbar's, just standard stuff so far.

    What I want to do is be able to detect specific types of events in the MainWindow. The category is any user action with the mouse that causes the screen contents to change and would make it look different than before. For example, the child QDockWidget's can be made not visible, be restored, repositioned, resized. Also the toolbars can be repositioned and resized.

    It wouldn't work to have each child object detect this itself and signal the MainWindow (for example) because I need to distinguish between user actions upon individual widgets and something like restoreState actions, which I have as a main menu item. So i need to know whether the screen change was due to the user changing a specific child widget or the user choosing the menu item (or toolbar button to do this) restoreState option.

    If anybody has any good suggestions I would really appreciate some tips.

    Thanks.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrdebug
      wrote on 9 Aug 2013, 16:30 last edited by
      #2

      In Windows per esempio, è possibile utilizzare il modo VNC. Devi costruire una dll e allegarlo a ciascuno dei processi di sessione. Con esso è possibile avere gli eventi come evento del mouse e altro ancora.

      Need programmers to hire?
      www.labcsp.com
      www.denisgottardello.it
      GMT+1
      Skype: mrdebug

      1 Reply Last reply
      0
      • C Offline
        C Offline
        chooser
        wrote on 13 Aug 2013, 13:10 last edited by
        #3

        I'm not sure what that is saying as it is not in quite in English.

        Anybody??? Going once....Maybe I need to simplify my question...if so feel free to comment on that as well.

        Thanks

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mrdebug
          wrote on 13 Aug 2013, 13:17 last edited by
          #4

          Sorry for the mistake.

          In Windows, for example, you can use a VNC mode. You have to build a dll and attach it to each of the processes of the session. With it you can have events such as mouse events, and more.

          Need programmers to hire?
          www.labcsp.com
          www.denisgottardello.it
          GMT+1
          Skype: mrdebug

          1 Reply Last reply
          0
          • R Offline
            R Offline
            raven-worx
            Moderators
            wrote on 13 Aug 2013, 13:26 last edited by
            #5

            there is no all-in-one wonder solution for this ;)
            QDockWidget and QToolBar provides signals for several types of changes.
            You will need to connect to them when you create the instances.

            If you don't want the signals to be triggered in some situations when you change something programatically you have to do this:
            @
            w->blockSignals(true);
            w-> ... // change something which might trigger signals
            w->blockSignals(false);
            @

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            1 Reply Last reply
            0
            • C Offline
              C Offline
              chooser
              wrote on 13 Aug 2013, 13:55 last edited by
              #6

              Well here is what I have tried so far;
              calling disconnect() on all the QDockWidget's and QToolsBar's so they wouldn't signal the MainWindow when I use the restoreState menu option.

              The only problem with that potential solution is that I have to reconnect them....at some point. How to know when to reconnect all these child objects.

              Any thoughts on my general idea and how to address this hole in my solution??

              1 Reply Last reply
              0
              • R Offline
                R Offline
                raven-worx
                Moderators
                wrote on 13 Aug 2013, 14:17 last edited by
                #7

                do as i said ... use blockSignals() when you don't want to trigger the signals...

                --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                If you have a question please use the forum so others can benefit from the solution in the future

                1 Reply Last reply
                0

                1/7

                9 Aug 2013, 16:18

                • Login

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