Skip to content

Commit

Permalink
QtPropertyBrowser: Fix an issue when setting "flagNames"
Browse files Browse the repository at this point in the history
Setting the "flagNames" attribute causes the QtFlagPropertyManager to
re-create its child properties. This causes the QtVariantPropertyManager
to re-create its wrapping QtVariantProperty instances.

When this happens with a property that is already added to a property
browser, the value icon and text were requested before the
QtVariantPropertyManager had set up the mapping between the wrapping
QtVariantProperty instance and the internal property. This caused the
returned icon and text for the child flag properties to be empty.

Change-Id: If2166136b4ae3931c229c215f90f8582da81d2c3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
  • Loading branch information
bjorn committed Jan 10, 2022
1 parent 9568abd commit 11730d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qtpropertybrowser/src/qtvariantproperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,10 @@ QtVariantProperty *QtVariantPropertyManagerPrivate::createSubProperty(QtVariantP
varChild->setStatusTip(internal->statusTip());
varChild->setWhatsThis(internal->whatsThis());

parent->insertSubProperty(varChild, after);

m_internalToProperty[internal] = varChild;
propertyToWrappedProperty()->insert(varChild, internal);

parent->insertSubProperty(varChild, after);
return varChild;
}

Expand Down

0 comments on commit 11730d4

Please sign in to comment.