Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.15.18, 6.8.1
-
None
-
Windows 10 22H2, Qt Creator 14.0.2
-
032ecd52f (dev), 884b3c575 (6.9), e9b829360 (6.8)
Description
Code
import QtQuick 2.15 import QtQuick.Window 2.15 Window { width: 640 height: 480 visible: true Component.onCompleted: console.log("Hi") Component.onDestruction: console.log("Bye") }
Outcomes
Sometimes, the warning doesn't appear at all:
11:45:11: Debugging D:\Test\untitled5\build\Desktop_Qt_6_8_1_MinGW_64_bit-Debug\debug\untitled5.exe "-qmljsdebugger=port:59836,block,services:DebugMessages,QmlDebugger,V8Debugger,QmlInspector,DebugTranslation" ... QML Debugger: Waiting for connection on port 59836... qml: Hi qml: Bye 11:45:15: Debugging of D:\Test\untitled5\build\Desktop_Qt_6_8_1_MinGW_64_bit-Debug\debug\untitled5.exe "-qmljsdebugger=port:59836,block,services:DebugMessages,QmlDebugger,V8Debugger,QmlInspector,DebugTranslation" has finished with exit code 0.
Sometimes, it appears after the app quits:
11:33:08: Starting D:\Test\untitled5\build\Desktop_Qt_6_8_1_MinGW_64_bit-Debug\debug\untitled5.exe... qml: Hi qml: Bye QML debugging is enabled. Only use this in a safe environment. 11:33:10: D:\Test\untitled5\build\Desktop_Qt_6_8_1_MinGW_64_bit-Debug\debug\untitled5.exe exited with code 0
Fix
If I add fflush(stderr); to the start of my main() function, then the warning appears at startup:
11:48:04: Debugging D:\Test\untitled5\build\Desktop_Qt_6_8_1_MinGW_64_bit-Debug\debug\untitled5.exe "-qmljsdebugger=port:64112,block,services:DebugMessages,QmlDebugger,V8Debugger,QmlInspector,DebugTranslation" ... QML debugging is enabled. Only use this in a safe environment. QML Debugger: Waiting for connection on port 64112... qml: Hi qml: Bye 11:48:07: Debugging of D:\Test\untitled5\build\Desktop_Qt_6_8_1_MinGW_64_bit-Debug\debug\untitled5.exe "-qmljsdebugger=port:64112,block,services:DebugMessages,QmlDebugger,V8Debugger,QmlInspector,DebugTranslation" has finished with exit code 0.
It looks like simply printing a newline character is not enough to flush the contents of stderr to Qt Creator's Application Output pane: https://codereview.qt-project.org/c/qt/qtdeclarative/+/251021/
Attachments
Issue Links
- resulted in
-
QTCREATORBUG-32201 Application Output pane: Treat stderr as unbuffered
- Reported
For Gerrit Dashboard: QTBUG-132350 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
612885,2 | QML debugging: Flush warning | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
616368,2 | QML debugging: Flush warning | 6.9 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
616397,2 | QML debugging: Flush warning | 6.8 | qt/qtdeclarative | Status: MERGED | +2 | 0 |