meadmaker
27th August 2010, 04:49
Hey guys/gals,
Hoping i could get some help. I'm new to QT and I am having a problem with getting the treeview to work right. I copied the treeitem and treemodel files from the simpletreemodel example in qtcreator. I imported the example data file as a resource into my project. When I debug the project, the model looks like it was created fine and the model gets loaded into the treeview. i can even look at the model by accessing it through the treeview itself. The problem is no data is displayed at all. Just blank. I feel like I must be missing something real obvious
here is the code i call to load in the model
QFile file(":/resources/default.txt");
bool test = file.open(QIODevice::ReadOnly);
TreeModel model(file.readAll());
file.close();
ui->navigationTreeView->setModel(&model);
ui->navigationTreeView->show();
any help would be appreciated
Hoping i could get some help. I'm new to QT and I am having a problem with getting the treeview to work right. I copied the treeitem and treemodel files from the simpletreemodel example in qtcreator. I imported the example data file as a resource into my project. When I debug the project, the model looks like it was created fine and the model gets loaded into the treeview. i can even look at the model by accessing it through the treeview itself. The problem is no data is displayed at all. Just blank. I feel like I must be missing something real obvious
here is the code i call to load in the model
QFile file(":/resources/default.txt");
bool test = file.open(QIODevice::ReadOnly);
TreeModel model(file.readAll());
file.close();
ui->navigationTreeView->setModel(&model);
ui->navigationTreeView->show();
any help would be appreciated