aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/scenegraph_lancelot
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/scenegraph_lancelot')
-rw-r--r--tests/manual/scenegraph_lancelot/scenegrabber/main.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/manual/scenegraph_lancelot/scenegrabber/main.cpp b/tests/manual/scenegraph_lancelot/scenegrabber/main.cpp
index 6da0799bbc..23c678380c 100644
--- a/tests/manual/scenegraph_lancelot/scenegrabber/main.cpp
+++ b/tests/manual/scenegraph_lancelot/scenegrabber/main.cpp
@@ -36,6 +36,11 @@
#include <QtQuick/QQuickView>
#include <QtQuick/QQuickItem>
+#ifdef Q_OS_WIN
+# include <fcntl.h>
+# include <io.h>
+#endif // Q_OS_WIN
+
// Timeout values:
// A valid screen grab requires the scene to not change
@@ -101,6 +106,10 @@ private slots:
#endif
if (ofile == "-") { // Write to stdout
QFile of;
+#ifdef Q_OS_WIN
+ // Make sure write to stdout doesn't do LF->CRLF
+ _setmode(_fileno(stdout), _O_BINARY);
+#endif // Q_OS_WIN
if (!of.open(1, QIODevice::WriteOnly) || !lastGrab.save(&of, "ppm")) {
qWarning() << "Error: failed to write grabbed image to stdout.";
QGuiApplication::exit(2);