Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.15.0
-
None
Description
Use QTabBar and set movable to true, I drag an unselected tab and it will be selected after letting go. I just want to move its position, could this be a bug?
It doesn't have to be macOS, it will appear in any style plugin that sets SH_TabBar_SelectMouseType to QEvent::MouseButtonRelease.
#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"); tw->setMovable(true); 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(); }
- Run the application
- Make sure the "One" tab is selected
- Press and move the "Two" tab to the "One" tab left side
- Release mouse button
- You will see the "Two" tab is selected
Attachments
Issue Links
- tests
-
QTBUG-85394 Crash in QTabBar when moving tabs due to QList::move deleting items
- Closed
Gerrit Reviews
For Gerrit Dashboard: QTBUG-85301 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
305988,2 | fix: don't switch current tab in drag progress of QTabBar | dev | qt/qtbase | Status: NEW | 0 | 0 |