Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected behaviour with tab drag on scrollable tab bar #641

Closed
ma-robox opened this issue Jun 5, 2024 · 1 comment
Closed

Unexpected behaviour with tab drag on scrollable tab bar #641

ma-robox opened this issue Jun 5, 2024 · 1 comment
Assignees
Labels

Comments

@ma-robox
Copy link

ma-robox commented Jun 5, 2024

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
@githubuser0xFFFF
Copy link
Owner

This should be fixed now in master - please test

ma-robox added a commit to ma-robox/Qt-Advanced-Docking-System that referenced this issue Jul 8, 2024
… on scrollable tab bar

(cherry picked from commit 1c41cbf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants