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. All my window blinks when using QProcess

All my window blinks when using QProcess

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 636 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.
  • R Offline
    R Offline
    rth42000
    wrote on last edited by
    #1

    In a multithreaded application I use a Qtprocess to launch an application external to my Qt application. The launch of this QtProcess is executed in a different thread from the GUI.

    This is how I launch my process and how I wait.
    QProcess Process;
    Process.setCreateProcessArgumentsModifier([] (QProcess::CreateProcessArguments *pCreateProcArgs)
    {
    pCreateProcArgs->flags |= CREATE_NO_WINDOW;
    pCreateProcArgs->startupInfo->dwFlags |= STARTF_USESHOWWINDOW | STARTF_FORCEOFFFEEDBACK;
    pCreateProcArgs->startupInfo->wShowWindow |= SW_HIDE | SW_SHOWNOACTIVATE;
    });
    Process.start( cmd );
    PrestoProcess.waitForFinished( 600000 );

    When my process finishes the window of my Qt application blinks, but the other applications running on my computer as well.
    The frame of my window blinks as if it received an event of focus ... well I think. Same for all the applications present on my PC.

    I want to avoid that all my windows flash. How to do?
    I have already set up a filter so that the cursor is not modified (hourglass)

    Thank you in advance for your help

    S A 2 Replies Last reply
    0
    • R rth42000

      In a multithreaded application I use a Qtprocess to launch an application external to my Qt application. The launch of this QtProcess is executed in a different thread from the GUI.

      This is how I launch my process and how I wait.
      QProcess Process;
      Process.setCreateProcessArgumentsModifier([] (QProcess::CreateProcessArguments *pCreateProcArgs)
      {
      pCreateProcArgs->flags |= CREATE_NO_WINDOW;
      pCreateProcArgs->startupInfo->dwFlags |= STARTF_USESHOWWINDOW | STARTF_FORCEOFFFEEDBACK;
      pCreateProcArgs->startupInfo->wShowWindow |= SW_HIDE | SW_SHOWNOACTIVATE;
      });
      Process.start( cmd );
      PrestoProcess.waitForFinished( 600000 );

      When my process finishes the window of my Qt application blinks, but the other applications running on my computer as well.
      The frame of my window blinks as if it received an event of focus ... well I think. Same for all the applications present on my PC.

      I want to avoid that all my windows flash. How to do?
      I have already set up a filter so that the cursor is not modified (hourglass)

      Thank you in advance for your help

      S Offline
      S Offline
      stryga42
      wrote on last edited by
      #2

      @rth42000 Hi, which operating system do you use? And which window manager? (If your OS gives you any choice :-) )

      1 Reply Last reply
      0
      • R rth42000

        In a multithreaded application I use a Qtprocess to launch an application external to my Qt application. The launch of this QtProcess is executed in a different thread from the GUI.

        This is how I launch my process and how I wait.
        QProcess Process;
        Process.setCreateProcessArgumentsModifier([] (QProcess::CreateProcessArguments *pCreateProcArgs)
        {
        pCreateProcArgs->flags |= CREATE_NO_WINDOW;
        pCreateProcArgs->startupInfo->dwFlags |= STARTF_USESHOWWINDOW | STARTF_FORCEOFFFEEDBACK;
        pCreateProcArgs->startupInfo->wShowWindow |= SW_HIDE | SW_SHOWNOACTIVATE;
        });
        Process.start( cmd );
        PrestoProcess.waitForFinished( 600000 );

        When my process finishes the window of my Qt application blinks, but the other applications running on my computer as well.
        The frame of my window blinks as if it received an event of focus ... well I think. Same for all the applications present on my PC.

        I want to avoid that all my windows flash. How to do?
        I have already set up a filter so that the cursor is not modified (hourglass)

        Thank you in advance for your help

        A Offline
        A Offline
        ambershark
        wrote on last edited by
        #3

        @rth42000 It sounds like it is losing and gaining focus back again cause it to flicker. Try setting your window to always on top then launch the process and then reset it back to a normal window zpos. See if that changes anything. If it does then at least we know where to look to solve the problem. If it doesn't chances are it's still creating a window even though you don't see it, which causes the flicker.

        Hard to tell without a screencast or video or something.

        Also try changing your process to be one without any custom flags, but make the process something that doesn't have a window. See if the flicker occurs. A simple process could just be something like:

        int main()
        {
           return 0;
        }
        

        It does nothing and should not create a window. Should be easy to test with.

        My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

        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