how to stop signals propagation further
hi
i have a listview which on double clicked on the icon can expand(invoking a custom slot to expand)
when clicked on the region other than the icon nothing expands(custom slot is not invoked)
so how to catch this signal and also that this signal should not be propagated further (because the custom slot will get executed).
Re: how to stop signals propagation further
Calling accept() on event stop furthur propagation.
Re: how to stop signals propagation further
yes but how to stop in build signals such as the
buttonClicked() signal in qbuttongroup class
Re: how to stop signals propagation further
You can always blockSignals()... but I don't see a reason in doing so. About your expanding problem - can't you connect the clicked() signal of the view to a slot of yours and call expand() on the index you get as the argument?
Re: how to stop signals propagation further
yes that is what i am doing when it is clicked on the icon of qdir
but when clicked on the other part,where there are no icons i need the screen to maximize and hide some of the widgets
Re: how to stop signals propagation further
Could you post a screenshot of the application window? I have trouble understanding what we are facing.
1 Attachment(s)
Re: how to stop signals propagation further
i have attached the screen shot
in the fourth window i have marked the area (dotted lines that surround " / " )which happens due to the click(where click is written manually) in the outer side of the icons presenting area.
when clicked on the icons the doubleclicked signal of listview is emitted ,but not on the area ,other than the icons present.
Re: how to stop signals propagation further
And you want that "/" item not to be "clickable"? It's enough if you call QModelIndex::isValid() in your slot and exit the slot if it returns false.
Re: how to stop signals propagation further
no
1) when clicked on the icon it shows sub directories(implemented by catching the
clicked() signal) which is fine
2) when clicked other than icon all the other windows (total 4 windows) should be hidden.
pardon if i cant explain clearly
Re: how to stop signals propagation further
In that case you need to reimplement the mouseReleaseEvent for the viewport and use indexAt() to check for the index under pointer. If it's invalid, emit a custom signal (like clickedInvalid()) or hide the other views manually. If it's valid, call the base class implementation of the event handler and it will emit clicked() for you.
Re: how to stop signals propagation further
thanks u wysota
i have not replied so long because only now i have understood your point.
till now i was searching a way around without using indexat function
Re: how to stop signals propagation further
And look how much time you wasted instead of using a method that was designed for what you want.
Re: how to stop signals propagation further
right
but there are lot of functions and understanding the functionalities of all the functions takes time:)
Re: how to stop signals propagation further
Using Qt Assistant and browsing API of the classes you use is essential.