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

QMainWindow::setAnimated(false) breaks DockWidgets/MouseEvents

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 6.9.0
    • Widgets: Main Window
    • None
    • I am using kubuntu 24.10 with plasma 6, wayland on a 4k display.
    • Linux/Wayland

      I have created a small example project which you can use to replicate this issue and I attached it to this ticket.

      When I set the animated flag of QMainWindow to false DockWidgets will prevent mouse events to work properly.

      When you open this app, undock the dock widget and dock it back! Then the mainWindow's menu-bar will not work anymore. In fact all mouse events won't work anymore for this mainWindow.

      #include "mainwindow.h"
      #include "./ui_mainwindow.h"
      #include <qdockwidget.h>
      
      MainWindow::MainWindow(QWidget *parent)
          : QMainWindow(parent)
          , ui(new Ui::MainWindow)
      {
          ui->setupUi(this);
          setAnimated(false);
          QDockWidget *dockWidget = new QDockWidget(this);
          dockWidget->setMinimumWidth(200);
          addDockWidget(Qt::RightDockWidgetArea, dockWidget);
      }
      
      MainWindow::~MainWindow()
      {
          delete ui;
      }
       

      I did test this behaviour under windows => under windows this works fine

      I am setting animated to false, because in my project i have a slow centralWidget.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            robertwermuth Robert Wermuth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes