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

QMainWindow::restoreState corrupts relation between toolbars layout item

    XMLWordPrintable

Details

    • All
    • 2ed54dedf3 (qt/qtbase/dev) 2ed54dedf3 (qt/tqtc-qtbase/dev) 1ed89b7012 (qt/qtbase/6.4) 1ed89b7012 (qt/tqtc-qtbase/6.4) 53e3c7ed9f (qt/qtbase/6.3) 53e3c7ed9f (qt/tqtc-qtbase/6.3) 5b409aa872 (qt/tqtc-qtbase/6.2) da4f2177f8 (qt/tqtc-qtbase/5.15)

    Description

      After QMainWindow::restoreState() is called the widgetItem is set to nullptr for the toolbar. Which can lead to crash in some situation.

      When looking into more deeper, A toolbar knows the layout item (it is a QWidgetItemV2 instance) which are wrapped in (via QWidgetPrivate::widgetItem) But after QMainWindow::restoreState the widgetItem is set to nullptr for the toolbar, although there is a new layout item containing it.

      I attached a small program to reproduce the problem. It logs Null pointer after restoreState.

      Attachments

        For Gerrit Dashboard: QTBUG-102395
        # Subject Branch Project Status CR V

        Activity

          People

            ivan.solovev Ivan Solovev
            irfan.omair@digia.com Irfan Omair
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes