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

tabPosition called with out-of-bounds when closing an undocked QDockWidget

    XMLWordPrintable

Details

    • Windows
    • e6d85cf28 (dev), a884cf6e8 (tqtc/lts-6.5), 9557d1ca9 (6.6)

    Description

      When creating a floating QDockWidget with a parent and closing it with the mouse, qt raise a warning:

      QMainWindowLayout::tabPosition called with out-of-bounds value '0'

       

      There is no warning if:

       - The QDockWidget has no parent
       - The QDockWidget is closed programmatically
       - The QDockWidget is docked and undocked before closing

       

      Tested with various version (5.9, 5.11.9 ,5.12, 5.15.1) all show the issue
      The issue was not here in Qt 5.7.1

       

      Simple code to reproduce the issue:

      int main(int argc, char* argv[])
      {
        QApplication lApp(argc, argv);
        QMainWindow a;
        a.setCentralWidget(new QLabel("Main"));
        a.show();
        auto lWindow = new QDockWidget(&a);
        lWindow->setFloating(true);
        lWindow->show();
        return lApp.exec();
      }
      

       

      You can check the discussion is this forum post for more detail about call stack:

      https://forum.qt.io/topic/120411/warning-when-closing-an-undocked-qwidget/12

      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
            mwoua_leddar David Lévy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes