Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Incorrect QtProperty Order on QtTreePropertyBrowser

    General and Desktop
    1
    2
    1777
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Y
      yaseminyilmaz last edited by

      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

      1 Reply Last reply Reply Quote 0
      • Y
        yaseminyilmaz last edited by

        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?

        1 Reply Last reply Reply Quote 0
        • First post
          Last post