@@ -101,7 +101,7 @@ void PropertyTreeWidget::setModel(PropertyTreeModel * model)
101
101
if (model_) {
102
102
connect (
103
103
model_, SIGNAL (propertyHiddenChanged (const Property*)),
104
- this , SLOT (propertyHiddenChanged (const Property*)), Qt::QueuedConnection );
104
+ this , SLOT (propertyHiddenChanged (const Property*)), Qt::DirectConnection );
105
105
connect (
106
106
model_, SIGNAL (expand (const QModelIndex&)),
107
107
this , SLOT (expand (const QModelIndex&)));
@@ -117,12 +117,14 @@ void PropertyTreeWidget::setModel(PropertyTreeModel * model)
117
117
void PropertyTreeWidget::propertyHiddenChanged (const Property * property)
118
118
{
119
119
if (model_) {
120
- const auto & parent_index = model_->parentIndex (property);
121
- if (parent_index.isValid ()) {
122
- setRowHidden (property->rowNumberInParent (), parent_index, property->getHidden ());
123
- } else {
124
- printf (" Trying to hide property '%s' that is not part of the model.\n " ,
125
- qPrintable (property->getName ()));
120
+ if (property->parent () != nullptr ) {
121
+ const auto & parent_index = model_->parentIndex (property);
122
+ if (parent_index.isValid ()) {
123
+ setRowHidden (property->rowNumberInParent (), parent_index, property->getHidden ());
124
+ } else {
125
+ printf (" Trying to hide property '%s' that is not part of the model.\n " ,
126
+ qPrintable (property->getName ()));
127
+ }
126
128
}
127
129
}
128
130
}
0 commit comments