[Qt-interest] QTreeView Issue
Sujan Dasmahapatra
sdh at lmglasfiber.com
Mon Mar 9 08:51:28 CET 2009
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.
Kind regards,
LM Glasfiber R&D (India) Pvt. Ltd.
Sujan Dasmahapatra
Project Engineer - CFD
Telephone: +91 80 66470248
Mobile:
E-mail: sdh at lmglasfiber.com <mailto:sdh at lmglasfiber.com>
--------------------------------------------------------------
This e-mail and any attachments are confidential. If you are not the
named or intended recipient, please notify the sender immediately and do
not disclose the contents to any other person, use it for any purpose or
store or copy the information in any medium. Any unauthorized
disclosure, use or storage is prohibited and might be unlawful.
-------------------------------------------------
This E-mail and any attachments are confidential. If you are not the named or intended receipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose or store or copy the information in any medium. Any unauthorized disclosure, use or storage is prohibited and might be unlawful.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090309/efeebdf1/attachment.html
More information about the Qt-interest-old
mailing list