Hi,

I've been trying to set up a series of basic types for use with a QtPropertyBrowser but I can't seem to make the children of a read only property be read only as well.

For example:

I have an QObject that has a member that is a read only axis aligned bounding box property (a custom type I added). That AABB (axis aligned bounding box) is in turn composed of two vectors (the vectors are composed of XYZ and are also a custom type I added).

I would like the two vectors and the components of those vectors to be read only but I don't understand what I need to set up to make that happen.

Following the examples I have a read only property manager and an editable property manager. I constructed the AABB property from read only manager, but somehow its child properties manage to find a factory to create editors with. Strangely enough, if I add a double property to the read only manager itself, that double is not editable.

When I create the AABB it looks like:

Qt Code:
  1. void AABB3F_PropertyManager::initializeProperty( QtProperty *property )
  2. {
  3. d_ptr->mValues[ property ] = AABB3F_PropertyManagerPrivate::Data();
  4.  
  5. QtVariantProperty* minProp = d_ptr->mVariantPropertyManager->addProperty( qMetaTypeId< Vector3F_Property >(), "Min" );
  6. QtVariantProperty* maxProp = d_ptr->mVariantPropertyManager->addProperty( qMetaTypeId< Vector3F_Property >(), "Max" );
  7.  
  8. Vector3F_Property p;
  9. p.x = p.y = p.z = 0;
  10.  
  11. d_ptr->mVariantPropertyManager->setValue( minProp, qVariantFromValue( p ) );
  12. d_ptr->mVariantPropertyManager->setValue( maxProp, qVariantFromValue( p ) );
  13.  
  14. d_ptr->mPropertyToMin[ property ] = minProp;
  15. d_ptr->mPropertyToMax[ property ] = maxProp;
  16.  
  17. d_ptr->mMinToProperty[ minProp ] = property;
  18. d_ptr->mMaxToProperty[ maxProp ] = property;
  19.  
  20. property->addSubProperty( minProp );
  21. property->addSubProperty( maxProp );
  22. }
To copy to clipboard, switch view to plain text mode 

I construct the property managers like so:

Qt Code:
  1. {
  2. mVariantManager = new VariantManager( this );
  3. mReadOnlyVariantManager = new VariantManager( this );
  4.  
  5. mVariantFactory = new QtVariantEditorFactory( this );
  6.  
  7. setFactoryForManager( mVariantManager, mVariantFactory );
  8. }
To copy to clipboard, switch view to plain text mode 

Could anyone point me in the right direction? I find the property browser quite confusing. Even adding a couple of new types was a lot more glue code than I expected so I'm probably doing something wrong, but I don't know what else to try right now.