Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Incorrect QtProperty Order on QtTreePropertyBrowser
Forum Updated to NodeBB v4.3 + New Features

Incorrect QtProperty Order on QtTreePropertyBrowser

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.9k Views 1 Watching
  • 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 Offline
    Y Offline
    yaseminyilmaz
    wrote on last edited by
    #1

    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
    0
    • Y Offline
      Y Offline
      yaseminyilmaz
      wrote on last edited by
      #2

      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
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved