Incorrect QtProperty Order on QtTreePropertyBrowser
-
Hi all,
I have added the properties to QtTreePropertyBrowser for selected QGraphicsItem objects on QGraphicsScene. But the property order of the browser changes dynamically when I select an item. I couldn't see the properties as the following (added order: ID -> Label -> X -> Y. For example, incorrect order: Label -> X -> Y -> ID). What can the problem be?
@
void setPropertiesForManager()
{
QtVariantProperty *pIdentifier = mPropertyManager->addProperty(QVariant::Int, "ID");
pIdentifier->setValue(mID);QtVariantProperty *pLabel = mPropertyManager->addProperty(QVariant::String, "Label");
pLabel->setValue(mItemDef);QtVariantProperty *pXCoord = mPropertyManager->addProperty(QVariant::Int, "X");
pXCoord->setValue(mNodeList[0]->x());QtVariantProperty *pYCoord = mPropertyManager->addProperty(QVariant::Int, "Y");
pYCoord->setValue(mNodeList[0]->y());IController::getInstance()->updatePropertyBrowser(mPropertyManager);
}void updatePropertyBrowser(QtVariantPropertyManager *iPropertyManager)
{
this->clear();this->mPropertyMgr = iPropertyManager; QSet<QtProperty *>::const_iterator i = mPropertyMgr->properties().constBegin(); while (i != mPropertyMgr->properties().constEnd()) { this->addProperty(*i); qDebug() << ((QtVariantProperty *)(*i))->value(); ++i; } this->setFactoryForManager(mPropertyMgr, mFactory); this->show();
}
@
Thanks a lot for your helps and explanations,
Yasemin -
Is there any examples related to QtTreePropertyBrowser?
I have find a documentation at link http://www.wiki.crossplatform.ru/index.php/The_Property_Browser_Framework . Is there other links you know? Can we say that Qt recommends using other classes instead of QtTreePropertyBrowser because of not having documentation?