Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Event on start of method and catch with eventfilter immediately



  • Hi all,
    it is possible send event on the start of method, catch event and then continue code in method.

    I need create this system:

    1. start method where I will change image
    2. on start of this method send event - image will be changed
    3. then continue with code of changing image
    4. on the end of method send event that image changed

    I create library with image filters and I need sending events to main app where eventfilter catch events from library and modify GUI.

    Thank you Ladislav


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Are you sure you want an event or is it a signal ?



  • Hi,
    I don't know what is better approach for my purpoise. Currently I am using events at the end of method. And in main app class I have installed eventfilter to qApp.

    I need:

    1. Before I start working on image, send information "Now I will changing image - show progress - backup current image variable"
    2. Start changing image and at the end of algorithm send info "Image finished"

    Currently at the end of algorithm I am sending event "Image finished". So I wondered about create event in synchronize thread on the start of algorithm, but I don't know if this solve my problem.

    Requirement is write minimum code in main app. Every thing else I am coding as library and than link to main app.

    Thank you for advice


  • Lifetime Qt Champion

    Then it sounds that you should use signals and slots rather than events, like e.g. in Qt's Model/View implementation. For column insertion there's a signal emitted as well as once the column has been inserted.


Log in to reply