Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Signals not emitted when the window is hidden

    General and Desktop
    2
    3
    849
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      technovelist last edited by

      I have just run into a problem with my program when the main window is not shown. This is intended for a "batch processing" mode in which the GUI is not needed.

      The problem is that the signals such as "editingFinished" that connect the ui objects to my program functions are not being fired even though I'm actually attempting to change the contents of those ui objects via program commands. Thus, the functions that should be executed when those ui objects are changed are not being called.

      Is there a way to tell Qt that I want those signals to be fired even though the window is not visible?

      Here's some of the code that emits the "editingFinished" signal when the window is visible but not when it is hidden:

      		m_uiElement->setStyleSheet(m_ActiveBackgroundColorStyleSheet);
      		m_uiElement->setFocus();
      

      Thanks!

      1 Reply Last reply Reply Quote 0
      • G
        Gerd last edited by

        "editingFinished" is emitted on hitting the Enter/Return key or on loosing focus on that widget. A hidden widget will never get keyboard-events or focus events, so there's no trigger for that signal.

        If you are changing properties of an widget via program there may be other signals that can be used like "textChanged".
        Another way to implement what you need is to emit a self defined signal form the code the does the changes and react on this.

        regards
        gerd

        1 Reply Last reply Reply Quote 0
        • T
          technovelist last edited by

          That is helpful. Thanks!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post