--- qt-4.7.3-orig/src/gui/embedded/qkbdlinuxinput_qws.cpp	2012-01-23 11:23:53.000000000 +0100
+++ qt-4.7.3/src/gui/embedded/qkbdlinuxinput_qws.cpp	2012-01-23 12:50:12.000000000 +0100
@@ -128,7 +128,7 @@
         // play nice in case we are started from a shell (e.g. for debugging)
         m_tty_fd = isatty(0) ? 0 : -1;
 
-        if (m_tty_fd >= 0) {
+        if (m_tty_fd >= 0 && args.first().toLower() == "tty" ) {
             // save tty config for restore.
             tcgetattr(m_tty_fd, &m_tty_attr);
 
