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

QDockWidget is covered under main window after setFloating(true)

    XMLWordPrintable

Details

    • Linux/Wayland, Linux/X11

    Description

      I want a dock widget to be floating at the beggining. So I add dock widget to the area and then setFloating(true). But the behaviour is that this dock widget is cover under main window (wont stayin on top)

      MainWindow::MainWindow(QWidget *parent) :
         QMainWindow(parent),
         ui(new Ui::MainWindow)
       {
         auto* dock = new QDockWidget(this);
         auto* widget = new QWidget(dock);
         auto* layout = new QHBoxLayout();
         widget->setLayout(layout);
         dock->setWidget(widget);
         addDockWidget(Qt::RightDockWidgetArea, dock);
         dock->setFloating(true);
       
       
         layout->addWidget(new QPushButton("test", this));
       }

      Dock widget is visible in the right top corner, but when I drag the main window, dock widget hides under it. To fix it I have to drag dock widget to the dock area, then I set it floating again, and this widget is on top.

      How to force QDockWidget to be floating and on top at the beginning?

      Qt Version 5.11.1 on Ubuntu 18.04

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes