QtTreePropertyBrowser/QTreeWidget crash
-
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;
}
@