Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.12.6, 5.14.0
-
None
-
OS X 10.13, OS X 10.14, OS X 10.15
-
-
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.