Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-42775

QPushButton released() signal is not emitted when it should be on focus out or when the button is disabled

    XMLWordPrintable

Details

    • 971b8413f27f6e317e9e37f518fcc1e6b9eed978

    Description

      When a QPushButton has been pressed down and the user changes focus to another widget without releasing the mouse (using either the arrow keys or tab key) then the released() signal of the button is not emitted. The released() signal is also not emitted if the button becomes ghosted while the button is pressed down. Moving the mouse after changing the focus to another widget corrects the issue as long as the button is not ghosted.

      The steps to reproduce this issue by changing focus are as follows:
      1. Compile and run main.cpp
      2. Left click on the 'test' button with the mouse but do not release the mouse
      3. Without moving the mouse, use the tab or arrow keys to change focus to another button on the dialog and release the mouse button

      The steps to reproduce this issue by disabling the button are as follows:
      1. Compile and run main.cpp
      2. Left click on the 'test' button with the mouse but do not release the mouse
      3. Without moving the mouse, use the tab or arrow keys to change the focus to the 'ghost test button' button and press this toggle button using the spacebar

      The sample program prints a string to the terminal each time the pressed() or released() signal for the 'test' button is emitted in order to demonstrate the behavior. In each case described above, only the pressed() signal is emitted. This leads to problems with any code that relies on the pressed() signal to begin an action and the released() signal to stop the action.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            frederik Frederik Gladhorn
            jmason Joseph Mason
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes