Undo/Redo does not work correctly with Histogram
Steps to reproduce :
- Sphere, Apply
- Histogram, Apply
- Undo, Undo,
- Redo, Redo
Attribute Type is set to Field Data instead of Row Data, no data visible.
This issue disappear between Qt 5.10 and Qt 5.12, but it is present in ParaView 5.8.0 (hence in the release)
I've narrowed it down to pqComboBoxDomain::internalDomainChanged() where this code is not behaving as expected
if (oldData != data)
{
// save previous value to put back
QVariant old;
if (combo->count() > 0)
{
old = combo->itemData(combo->currentIndex());
}
else
{
// the combo-box doesn't have any values currently, which implies that the
// domain is being setup of the first time. However, it's still possible
// that the property's value was already set (eg. undo/redo) so we need to
// ensure that we use the property value rather than the item in the
// combo-box.
old = cur_property_value;
}
We should go into the else, but we go into the if because the combo box is already initialized for some reason.