Qt-interest Archive, August 2006
QTreeView - mouseButtonPressed event
Message 1 in thread
Hi,
I'd like to get rid of any selection in a tree view, if I click on an
empty space. Therefore, I tried to install an eventFilter in the
QTreeView in order to handle mouse events and clear the selection.
The problem is, I never get mousePressedEvents. Why doesn't this work?
Are there other ways to get rid of the selection?
(I need to create siblings of the top level item; whenever the selection
is empty a new top-level item is created, otherwise the selected item is
taken as parent)
tia,
Hannes
--
[ signature omitted ]
Message 2 in thread
Hannes wrote:
> Hi,
>
> I'd like to get rid of any selection in a tree view, if I click on an
> empty space. Therefore, I tried to install an eventFilter in the
> QTreeView in order to handle mouse events and clear the selection.
> The problem is, I never get mousePressedEvents. Why doesn't this work?
> Are there other ways to get rid of the selection?
> (I need to create siblings of the top level item; whenever the selection
> is empty a new top-level item is created, otherwise the selected item is
> taken as parent)
QTreeView->QAbstractScrollView => filter viewport()
Stefan
--
[ signature omitted ]