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. QtTreePropertyBrowser/QTreeWidget crash
Forum Updated to NodeBB v4.3 + New Features

QtTreePropertyBrowser/QTreeWidget crash

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 2.4k 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.
  • S Offline
    S Offline
    steno
    wrote on last edited by
    #1

    Been using Qt solutions with the QtTreePropertyBrowser and have found a very simple crash. I'm trying to find the cause, but haven't had any luck. I'm not sure if it is caused by the QtTreePropertyBrowser or the QTreeWidget the property browser uses. Was wondering if others have come across this or might know of a possible bug fix for it?

    @

    #include <QtGui>

    #include "qtpropertymanager.h"
    #include "qteditorfactory.h"
    #include "qttreepropertybrowser.h"
    #include "qtbuttonpropertybrowser.h"
    #include "qtgroupboxpropertybrowser.h"

    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);

    QWidget *w = new QWidget();
    
    QtBoolPropertyManager *boolManager = new QtBoolPropertyManager(w);
    QtStringPropertyManager *stringManager = new QtStringPropertyManager(w);
    QtGroupPropertyManager *groupManager = new QtGroupPropertyManager(w);
    
    QtProperty *item0 = groupManager->addProperty("QObject");
    
    QtProperty *item1 = stringManager->addProperty("objectName");
    item0->addSubProperty(item1);
    
    QtProperty *item2 = boolManager->addProperty("enabled");
    item0->addSubProperty(item2);
    
    QtCheckBoxFactory *checkBoxFactory = new QtCheckBoxFactory(w);
    QtLineEditFactory *lineEditFactory = new QtLineEditFactory(w);
    
    QtTreePropertyBrowser *editor1 = new QtTreePropertyBrowser();
    editor1->setFactoryForManager(boolManager, checkBoxFactory);
    editor1->setFactoryForManager(stringManager, lineEditFactory);
    editor1->setResizeMode(QtTreePropertyBrowser::ResizeToContents);
    
    QVBoxLayout *layout = new QVBoxLayout();
    layout->addWidget(editor1);
    w->setLayout(layout);
    
    editor1->addProperty(item0);
    
    QListIterator<QtBrowserItem *> itItem(editor1->items(item1));
    while (itItem.hasNext())
    {
        QtBrowserItem *item = itItem.next();
    
        editor1->setItemVisible(item, false);
    }
    
    itItem = editor1->items(item2);
    while (itItem.hasNext())
    {
        QtBrowserItem *item = itItem.next();
    
        editor1->setItemVisible(item, false);
    }
    
    w->show();
    
    app.exec();
    return 0;
    

    }

    @

    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