diff --git a/share/qtcreator/gdbmacros/gdbmacros.py b/share/qtcreator/gdbmacros/gdbmacros.py
index ea2521c6e31b2c7a6f6447ab32e7f473612f1bc5..d8517218ba69ca27d7eb1b89ff656c8a7f3df014 100644
--- a/share/qtcreator/gdbmacros/gdbmacros.py
+++ b/share/qtcreator/gdbmacros/gdbmacros.py
@@ -456,7 +456,7 @@ def qdump__QImage(d, item):
         else:
             # Write to an external file. Much faster ;-(
             file = tempfile.mkstemp(prefix="gdbpy_")
-            filename = file[1]
+            filename = file[1].replace("\\", "\\\\")
             p = bits.cast(gdb.lookup_type("unsigned char").pointer())
             gdb.execute("dump binary memory %s %s %s" %
                 (filename, cleanAddress(p), cleanAddress(p + nbytes)))