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. Disable click for 3-5 minute
Forum Updated to NodeBB v4.3 + New Features

Disable click for 3-5 minute

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 4 Posters 331 Views 2 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.
  • mangekoyuM Offline
    mangekoyuM Offline
    mangekoyu
    wrote on last edited by
    #1

    I want to disable click for whole application while receiving data from serial connection. I want to print information on the screen with a message box and turn off clicking for a certain time, how can I do it?

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

      Hi and welcome to devnet,

      That's what QProgressDialog is usually used for. You can remove the cancel button from it too.

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

      1 Reply Last reply
      4
      • mangekoyuM mangekoyu

        I want to disable click for whole application while receiving data from serial connection. I want to print information on the screen with a message box and turn off clicking for a certain time, how can I do it?

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #2

        @mangekoyu
        Quite untested, but if you setDisabled(true) on your very top-level widget(s) doesn't that disable all its descendant widgets so that none of them will accept any input?

        Otherwise you might look at installing a top-level eventFilter() on the entire application as per https://doc.qt.io/qt-6/eventsandfilters.html#event-filters

        It is also possible to filter all events for the entire application, by installing an event filter on the QApplication or QCoreApplication object. Such global event filters are called before the object-specific filters.

        and have it ignore events during your period.

        Note that this "complete disablement" may not be the ideal way to handle the situation. But that is what you asked for.

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

          Hi and welcome to devnet,

          That's what QProgressDialog is usually used for. You can remove the cancel button from it too.

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

          1 Reply Last reply
          4
          • mangekoyuM Offline
            mangekoyuM Offline
            mangekoyu
            wrote on last edited by
            #4

            Thank you for answers. It works. Now I need to connect progress bar to serial.

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

              You should not connect it to the serial port itself. Have a controller class that manages the serial port communication and that will generate start and end signals or a progress signal that you will use to manage your progress dialog.

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

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SimonSchroeder
                wrote on last edited by
                #6

                To add to @SGaist: If you don't know the percentage you can just put in the range (0,0). This will just be an indicator that your software is doing something. The key point is that the progress dialog is modal and will thus block input to everything else but itself.

                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