Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

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

    General and Desktop
    3
    6
    820
    Loading More Posts
    • 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
      davecotter last edited by

      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 Reply Quote 0
      • D
        davecotter last edited by

        Install an event filter and check for the close event.

        This worked!! Thanks!!

        1 Reply Last reply Reply Quote 0
        • D
          davecotter last edited by

          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 Reply Quote 0
          • Christian Ehrlicher
            Christian Ehrlicher Lifetime Qt Champion last edited by

            Derive from QProcessDialog and override the closeEvent()

            Qt has to stay free or it will die.

            1 Reply Last reply Reply Quote 1
            • D
              davecotter last edited by

              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 Reply Quote 0
              • Chris Kawa
                Chris Kawa Moderators last edited by

                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 Reply Quote 4
                • D
                  davecotter last edited by

                  Install an event filter and check for the close event.

                  This worked!! Thanks!!

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post