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. QProgressDialog: remove cancel button doesn't remove key handling of cancel button?
Forum Updated to NodeBB v4.3 + New Features

QProgressDialog: remove cancel button doesn't remove key handling of cancel button?

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 1.4k 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.
  • D Offline
    D Offline
    davecotter
    wrote on last edited by
    #1

    I have a progress dialog on startup, showing, well ... startup progress.

    there isn't a cancel buttton cuz i removed it (setCancelButton(NULL))

    however, hitting esc, cmd-., ctrl-c causes the dialog to dismiss itself.

    without overriding this dialog, how do i disable that?

    :)

    1 Reply Last reply
    0
    • D Offline
      D Offline
      davecotter
      wrote on last edited by
      #6

      Install an event filter and check for the close event.

      This worked!! Thanks!!

      1 Reply Last reply
      0
      • D Offline
        D Offline
        davecotter
        wrote on last edited by
        #2

        according to this topic, i tried this:

        disconnect(this, SIGNAL(canceled()), this, SLOT(cancel()));
        

        yet the escape key STILL cancels the dialog. ??

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #3

          Derive from QProcessDialog and override the closeEvent()

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          1
          • D Offline
            D Offline
            davecotter
            wrote on last edited by
            #4

            quote:

            without overriding this dialog, how do i disable that?

            if there isn't any way to do it without overriding, then there you have it.

            But i was wondering if there IS  in fact a way?

            1 Reply Last reply
            0
            • Chris KawaC Offline
              Chris KawaC Offline
              Chris Kawa
              Lifetime Qt Champion
              wrote on last edited by
              #5

              There are basically two ways to deal with events - overriding and event filters. Since you don't want to override you're left with the latter. Install an event filter and check for the close event.

              1 Reply Last reply
              4
              • D Offline
                D Offline
                davecotter
                wrote on last edited by
                #6

                Install an event filter and check for the close event.

                This worked!! Thanks!!

                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