Qt-interest Archive, November 2007
QTreeView's double click action?
Message 1 in thread
Dear TreeViewers,
I am working on QTreeView. Single click on the little box can expand or
collapse a node. Double click on an item do the similar thing.
I want the double-click to do something else, and I did it. Problem is
my double-click keeps expanding or collapsing my folder which I do not
know how to get ride of it. Does anyone know the trick how to remove
this default feature binding?
Thanks,
Lingfa
--
[ signature omitted ]
Message 2 in thread
On Nov 5, 2007, at 10:42 AM, Lingfa Yang wrote:
> I am working on QTreeView. Single click on the little box can
> expand or collapse a node. Double click on an item do the similar
> thing.
>
> I want the double-click to do something else, and I did it. Problem
> is my double-click keeps expanding or collapsing my folder which I
> do not know how to get ride of it. Does anyone know the trick how
> to remove this default feature binding?
I think you have to derive from QTreeView and redefine the
QAbstractItemView::mouseDoubleClickEvent() method. I did not look at
the source to verify, just at the Qt 4.2.3 documentation.
Brad
--
[ signature omitted ]
Message 3 in thread
On Monday 05 November 2007 20:48:27 Brad Howes wrote:
> On Nov 5, 2007, at 10:42 AM, Lingfa Yang wrote:
> > I am working on QTreeView. Single click on the little box can
> > expand or collapse a node. Double click on an item do the similar
> > thing.
> >
> > I want the double-click to do something else, and I did it. Problem
> > is my double-click keeps expanding or collapsing my folder which I
> > do not know how to get ride of it. Does anyone know the trick how
> > to remove this default feature binding?
>
> I think you have to derive from QTreeView and redefine the
> QAbstractItemView::mouseDoubleClickEvent() method. I did not look at
> the source to verify, just at the Qt 4.2.3 documentation.
One could installEventFilter (myCustomFilter)?
Frank
--
[ signature omitted ]
Message 4 in thread
On Nov 5, 2007, at 2:56 PM, Frank Hemer wrote:
>> I think you have to derive from QTreeView and redefine the
>> QAbstractItemView::mouseDoubleClickEvent() method. I did not look at
>> the source to verify, just at the Qt 4.2.3 documentation.
>
> One could installEventFilter (myCustomFilter)?
Yes, of course. I keep forgetting about that mechanism.
Brad
--
[ signature omitted ]
Message 5 in thread
Brad Howes wrote:
> On Nov 5, 2007, at 2:56 PM, Frank Hemer wrote:
>
>>> I think you have to derive from QTreeView and redefine the
>>> QAbstractItemView::mouseDoubleClickEvent() method. I did not look at
>>> the source to verify, just at the Qt 4.2.3 documentation.
>>
>>
>> One could installEventFilter (myCustomFilter)?
>
>
> Yes, of course. I keep forgetting about that mechanism.
>
Brad and Frank
I thought there might have an attribute setting for click response. If
not, I will install the filter for the double click.
Thank you for answers.
Regards,
Lingfa
--
[ signature omitted ]
Message 6 in thread
On 2007/11/5, Lingfa Yang <lingfa@xxxxxxx> wrote
> Brad Howes wrote:
>
> > On Nov 5, 2007, at 2:56 PM, Frank Hemer wrote:
> >
> >>> I think you have to derive from QTreeView and redefine the
> >>> QAbstractItemView::mouseDoubleClickEvent() method. I did not look at
> >>> the source to verify, just at the Qt 4.2.3 documentation.
> >>
> >>
> >> One could installEventFilter (myCustomFilter)?
> >
> >
> > Yes, of course. I keep forgetting about that mechanism.
> >
> Brad and Frank
>
> I thought there might have an attribute setting for click response. If
> not, I will install the filter for the double click.
>
> Thank you for answers.
> Regards,
> Lingfa
>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>
Perhaps this helps:
http://trolltech.com/developer/knowledgebase/faq.2006-12-21.9989617474/
--
[ signature omitted ]
Message 7 in thread
On 2007/11/5, Lingfa Yang <lingfa@xxxxxxx> wrote:
> Brad Howes wrote:
>
> > On Nov 5, 2007, at 2:56 PM, Frank Hemer wrote:
> >
> >>> I think you have to derive from QTreeView and redefine the
> >>> QAbstractItemView::mouseDoubleClickEvent() method. I did not look at
> >>> the source to verify, just at the Qt 4.2.3 documentation.
> >>
> >>
> >> One could installEventFilter (myCustomFilter)?
> >
> >
> > Yes, of course. I keep forgetting about that mechanism.
> >
> Brad and Frank
>
> I thought there might have an attribute setting for click response. If
> not, I will install the filter for the double click.
>
> Thank you for answers.
> Regards,
> Lingfa
>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>
Perhaps this helps:
http://trolltech.com/developer/knowledgebase/faq.2006-12-21.9989617474/
--
[ signature omitted ]