Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Unwanted Windows Command Prompt when using QSignalSpy::wait()
Qt 6.12 LTS is out! See what's new in the release blog

Unwanted Windows Command Prompt when using QSignalSpy::wait()

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 748 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.
  • J Offline
    J Offline
    JKappes
    wrote on last edited by
    #1

    I'm using a QSignalSpy::wait() to wait for a specific reply during TCP communication. But by including testlib, the app always opens a command prompt on Windows. Is there any way to suppress that (I'm using qmake and coding on Debian btw)? Or can you suggest a workaround?

    Currently, I'm emitting a custom signal upon receiving the reply I expect, which is connected to a QSignalSpy.

    jsulmJ 1 Reply Last reply
    0
    • J JKappes

      I'm using a QSignalSpy::wait() to wait for a specific reply during TCP communication. But by including testlib, the app always opens a command prompt on Windows. Is there any way to suppress that (I'm using qmake and coding on Debian btw)? Or can you suggest a workaround?

      Currently, I'm emitting a custom signal upon receiving the reply I expect, which is connected to a QSignalSpy.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @JKappes said in Unwanted Windows Command Prompt when using QSignalSpy::wait():

      I'm using a QSignalSpy::wait() to wait for a specific reply during TCP communication

      Why? QSignalSpy is meant to be used in tests. If you really have to wait (do you really have to?) then you should use a local event loop instead.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      J 1 Reply Last reply
      2
      • jsulmJ jsulm

        @JKappes said in Unwanted Windows Command Prompt when using QSignalSpy::wait():

        I'm using a QSignalSpy::wait() to wait for a specific reply during TCP communication

        Why? QSignalSpy is meant to be used in tests. If you really have to wait (do you really have to?) then you should use a local event loop instead.

        J Offline
        J Offline
        JKappes
        wrote on last edited by
        #3

        @jsulm That's just the first way I got it to work.
        It's better for UX to wait, so I'll try an event loop. Thanks for the tip.

        jsulmJ 1 Reply Last reply
        0
        • J JKappes

          @jsulm That's just the first way I got it to work.
          It's better for UX to wait, so I'll try an event loop. Thanks for the tip.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @JKappes said in Unwanted Windows Command Prompt when using QSignalSpy::wait():

          It's better for UX to wait

          I disagree - you're blocking the UI, this can be frustrating for the user. But its you application.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1

          • Login

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