Skip to content

Unexpected behaviour with tab drag on scrollable tab bar #641

@ma-robox

Description

@ma-robox

Starting from the simple example, if I add multiple dock widgets to the same area, I obtain a long tab bar that can be scrolled. If I scroll to the right, and I try to drag a tab by 1 position (left or right), the tab is not dropped on the mouse position but to what I think is the relative position to the tab bar if I did not scroll it.

    ads::CDockAreaWidget *CenterArea = Q_NULLPTR;
    for (int i = 0; i < 60; i++)
    {
        // Create example content label - this can be any application specific
        // widget
        QLabel* l = new QLabel();
        l->setWordWrap(true);
        l->setAlignment(Qt::AlignTop | Qt::AlignLeft);
        l->setText("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. ");

        // Create a dock widget with the title Label 1 and set the created label
        // as the dock widget content
        ads::CDockWidget* DockWidget = new ads::CDockWidget(QString("Label %1").arg(i));
        DockWidget->setWidget(l);

        // Add the toggleViewAction of the dock widget to the menu to give
        // the user the possibility to show the dock widget if it has been closed
        ui->menuView->addAction(DockWidget->toggleViewAction());

        // Add the dock widget to the center dock widget area
        if (!CenterArea)
            CenterArea = m_DockManager->addDockWidget(ads::CenterDockWidgetArea, DockWidget);
        else
            m_DockManager->addDockWidgetTabToArea(DockWidget, CenterArea);
    }
bug_tab_bar.mp4

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions