itom crashes for invalid property in UI file

Issue #193 resolved
thomas kipp created an issue

In some of our .ui-files the property “enablePlotting” was set for an Itom2dQwtPlot like this:

<property name="enablePlotting" stdset="0">
  <bool>false</bool>
</property>

This seems to be invalid for a long time but did not cause any problems until we pulled in new changes on the 13.01.2022 (the working version before was last updated on 13.07.2021).

Since then, itom crashes completely with the message:

C:\itom\3rdParty\Qt5.14.2\5.15.2\msvc2017_64\bin\Qt5Cored.dll
Module: 5.14.2
File: itemmodels\qabstractitemmodel.cpp
Line: 2732

ASSERT: "first <= rowCount(parent)" in file
itemmodels\qabstractitemmodel.cpp, line 2732

Maybe someone with more insight on plots and .ui-file handling than me can track down the cause of this crash.

Cheers

Thomas

Comments (3)

  1. M. Gronle

    Hi Thomas,

    I can reproduce this error by manually inserting this property in an ui-file that contains an Itom2dQwtPlot. The problem is probably caused by the improved property dock widget of plots. In this improved property list you can filter properties by name, sort them or group them by their inheritance. enablePlotting seems to be added as “dynamic property” to the plot when it is loaded from an ui file.

    I try to figure out the correct reason for the crash and write if I have news.

    Cheers

    Marc

  2. M. Gronle

    After some debugging into the Qt sources, too, I found the problem. It comes from the QSortFilterProxyModel, that is on top of QPropertyModel. Already in QPropertyModel::addItem some beginInsertRows had to be replaced by resetItemModel to support the proxy model. The same technique was now used for
    adding dynamic properties within QPropertyModel::updateItem.

  3. Log in to comment