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

Tab widget button remains in pressed state after pressing, dragging and releasing mouse button

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.15.1
    • 5.12.6, 5.14.0
    • GUI: Look'n'Feel
    • None
    • OS X 10.13, OS X 10.14, OS X 10.15
    • macOS
    • c513b1214e38829e9bc23bb2ef948f5c388071a7 (qt/qtbase/dev) 52c2cd0a869392d5fbae56fd22c00c309255cec1 (qt/qtbase/5.15)

    Description

      A button on a tab widget will remain in its pressed state when it should not be.

      Minimal code:

      #include <QApplication>
      #include <QMainWindow>
      #include <QTabWidget>
      #include <QVBoxLayout>
      
      class TestWindow : public QMainWindow
      {
      public:
          TestWindow(QWidget *parent = nullptr) : QMainWindow(parent)
          {
              QTabWidget* tw = new QTabWidget;
      
              QWidget* w1 = new QWidget;
              QWidget* w2 = new QWidget;
      
              tw->addTab( w1, "One" );
              tw->addTab( w2, "Two");
      
              QVBoxLayout* l = new QVBoxLayout;
              l->addWidget(tw);
      
              QWidget* w = new QWidget;
              w->setLayout(l);
              setCentralWidget(w);
          }
      };
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          TestWindow w;
          w.show();
          return a.exec();
      }
      

      Steps to reproduce:

      • Launch the application
      • (Tab "One" is selected) (see Capture1.png)
      • Move the mouse pointer to the tab "Two" button
      • Press the left mouse button
      • Drag the mouse pointer away from the button
      • Release the left mouse button
      • (Tab 2 will still be drawn as if it is pressed) (see Capture2.png)

      The pressed state should be removed as soon as the mouse pointer is no longer over the button, or as soon as the mouse button is no longer pressed.

      Attachments

        1. Capture1.png
          Capture1.png
          6 kB
        2. Capture2.png
          Capture2.png
          7 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            wang_chuan wang chuan
            fdca_enfocus fdca_enfocus
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes