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. Error in Property Browser Project
Forum Updated to NodeBB v4.3 + New Features

Error in Property Browser Project

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 554 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.
  • U Offline
    U Offline
    urmila
    wrote on last edited by
    #1

    I am using property browser project using variant approach. I have copied a piece of code from the documentation to test it. But it is giving error 4700 uninitialized local variable priority used. My code is:
    @void createVariantManagerbrowser(){

    QtVariantPropertyManager *variantManager = new QtVariantPropertyManager();
    variantManager->addProperty(QVariant::Int, "Priority");
    QtVariantProperty *priority ;

    priority->setToolTip("Task Priority");
    priority->setAttribute("minimum", 1);
    priority->setAttribute("maximum", 5);
    priority->setValue(3);

    QtVariantProperty *reportType = variantManager->addProperty(QtVariantPropertyManager::enumTypeId(), "Report Type");
    QStringList types;
    types << "Bug" << "Suggestion" << "To Do";
    reportType->setAttribute("enumNames", types);
    reportType->setValue(1); // current value will be "Suggestion"

    QtVariantProperty *task1 = variantManager->addProperty(QtVariantPropertyManager::groupTypeId(), "Task 1");

    task1->addSubProperty(priority);
    task1->addSubProperty(reportType);

    QtTreePropertyBrowser *browser = new QtTreePropertyBrowser();

    QtVariantEditorFactory *variantFactory = new QtVariantEditorFactory();
    browser->setFactoryForManager(variantManager, variantFactory);
    //browser->setFactoryForManager(variantManager, variantFactory);

    browser->addProperty(task1);
    browser->show();
    delete variantManager;
    delete variantFactory;
    delete browser;

    }@
    I am unable to understand the problem.

    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