Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Signals not emitted when the window is hidden
Forum Updated to NodeBB v4.3 + New Features

Signals not emitted when the window is hidden

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 1.2k Views
  • 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 Offline
    T Offline
    technovelist
    wrote on last edited by
    #1

    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
    0
    • G Offline
      G Offline
      Gerd
      wrote on last edited by
      #2

      "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
      0
      • T Offline
        T Offline
        technovelist
        wrote on last edited by
        #3

        That is helpful. Thanks!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved