[Qt-interest] Retrieve a particular item from the QTreeView

Sajjad dosto.walla at gmail.com
Wed Mar 23 23:08:39 CET 2011


Hello Constantin,

Is there any difference between the signals pressed() and clicked().

I have subclass the QTreeView as well. I was wondering if i should over-ride
the mousePressEvent() of QTreeView instead.

Regards
Sajjad

On Wed, Mar 23, 2011 at 10:44 PM, Constantin Makshin <cmakshin at gmail.com>wrote:

> Take a look at QAbstractItemView::clicked(), QAbstractItemView::pressed()
> signals and selection model (returned by
> QAbstractItemView::selectionModel()) functions.
>
> On Thursday 24 March 2011 00:26:14 Sajjad wrote:
> > Hello forum,
> >
> > I have created a customized model by sub-classing the QAbstractItemModel
> > class and view the model in the QTreeView.
> >
> > Now when the user the click on a particular item in the tree view i want
> > retrieve the tree item from it.
> >
> > I have encapculated the QTreeView inside the customized widget. And then
> i
> > have over-ridden the mousePressEvent()
> >
> > {
> >      //I check for the left mouse press event and if not i return
> >
> >     //i need to look for the current clicked item - any way inside the
> > QTreeView to get it?
> > }
> >
> >
> >
> > Any hint to get it?
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110323/873e3b87/attachment.html 


More information about the Qt-interest-old mailing list