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

QColumnView setPreviewWidget breaks object if set when empty on windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.10, 6.4.2
    • GUI: Other
    • None
    • Windows 10
    • Windows

    Description

      Noticed on windows that setting a QColumnView's preview widget to something before any data has been added to a QStandardItemModel object (though the empty object has been set as the model of the QColumnView at this point) causes the object to break and then be unable to display anything (no data will ever show, no preview object will show). Oddly enough, this only seems to happen on windows, on a linux build of the same code, it works fine. Excerpt from the code:

       

      QStandardItemModel model_image_state;
      ...
      setupfunc(...)
      {
      ...
          colview_IMG_Images->setModel(&model_image_state);
          colview_IMG_Images->setPreviewWidget(verticalLayoutWidget);
          QStandardItem *group = new QStandardItem(QString("Image %1"));
          QStandardItem *child = new QStandardItem(QString("Slot %1"));
          group->appendRow(child);
          model_image_state.appendRow(group);
      } 

      If I run the above, I get this:

       

      If I switch the code around to this, I get:

       

      QStandardItemModel model_image_state;
      ...
      setupfunc(...)
      {
      ...
          colview_IMG_Images->setModel(&model_image_state);
          QStandardItem *group = new QStandardItem(QString("Image %1"));
          QStandardItem *child = new QStandardItem(QString("Slot %1"));
          group->appendRow(child);
          model_image_state.appendRow(group);
          colview_IMG_Images->setPreviewWidget(verticalLayoutWidget);
      } 

       

      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
            thedjnk Mr nK
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes