Dear Friends
I am into the development of a software for fluid engineering application. I am in the initial stage of the development.I am able to load a geometry through dialog.Now when the geometry is loaded that part’s name that is the file’s name should be updated in my tree view.
Now what I have done that I want to tell u. Please understand. I am creating a QTreeView which is set on the screen beside the central widget which is a QGraphicsView.Now for treeView I have done it like this ,
QTreeView *treeView;
QStandardItemModel *model;
QStandardItem *item;
treeView = new QTreeView;
model = new QStandardItemModel;
treeView->setModel(model);
treeView->show();
Now where in the open SLOT I am getting the fileName when my part is being read or loaded.That time I am doing like this
item = new QStandardItem(filename); // filename is QString
model->appendRow(item);
This way I am able to load the geometry and the filename is also updated in the treeView.Now I want to select the geometry from the treeView.If I load more than one geometry then I want to select that name in the treeView and then on right mouse press I should get 3 options select if not selected,deselect if selected and delete.And I want to perform the operations.
Could anyone please tell me whether my approach is correct and what I need to do to make selection from the treeView.
Bookmarks