Results 1 to 14 of 14

Thread: how to stop signals propagation further

  1. #1
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Question 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).

  2. #2
    Join Date
    Jun 2006
    Posts
    11
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to stop signals propagation further

    Calling accept() on event stop furthur propagation.

  3. #3
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Default Re: how to stop signals propagation further

    yes but how to stop in build signals such as the
    buttonClicked() signal in qbuttongroup class

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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?

  5. #5
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Default 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

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to stop signals propagation further

    Could you post a screenshot of the application window? I have trouble understanding what we are facing.

  7. #7
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Default 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.
    Attached Images Attached Images
    Last edited by babu198649; 22nd November 2007 at 13:28.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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.

  9. #9
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Default 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

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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.

  11. The following user says thank you to wysota for this useful post:

    babu198649 (27th November 2007)

  12. #11
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Smile 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
    Last edited by babu198649; 27th November 2007 at 09:05.

  13. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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.

  14. #13
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Default Re: how to stop signals propagation further

    right
    but there are lot of functions and understanding the functionalities of all the functions takes time

  15. #14
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to stop signals propagation further

    Using Qt Assistant and browsing API of the classes you use is essential.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.