Index: tests/widget/widget.cpp
===================================================================
--- tests/widget/widget.cpp	(revision 536)
+++ tests/widget/widget.cpp	(revision 611)
@@ -3,30 +3,6 @@
 #include <QtGui>
 
-#ifndef Q_WS_PM
-
-// For printing non-quoted QString's with QDebug)
-struct QDbgStr: public QString
-{
-    inline QDbgStr(const QString &str) : QString(str) {}
-};
-
-// Prints a non-quoted QString
-inline QDebug operator<<(QDebug dbg, const QDbgStr &str)
-{ dbg << str.toUtf8().constData(); return dbg; }
-
-QDbgStr qWidgetName(QWidget *w)
-{
-    if (w)
-        return QString()
-            .sprintf("%s.%s", w->metaObject()->className(),
-                     w->objectName().isEmpty() ? "<noname>" :
-                     w->objectName().toUtf8().constData());
-    return QString(QLatin1String("<no-widget>"));
-}
-
-#endif
-
 #define myDefFlagEx(var,fl,varstr,flstr) if (var & fl) { \
-    if (!varstr.isEmpty()) varstr += QLatin1String("|"); varstr += QLatin1String(flstr); \
+    if (!varstr.isEmpty()) varstr += "|"; varstr += flstr; \
 } else do {} while(0)
 
@@ -38,11 +14,11 @@
 QDebug operator<<(QDebug dbg, Qt::WindowStates st)
 {
-    QString name;
+    QByteArray name;
     myDefFlagEx(st, Qt::WindowMinimized, name, "Min");
     myDefFlagEx(st, Qt::WindowMaximized, name, "Max");
     myDefFlagEx(st, Qt::WindowFullScreen, name, "Full");
     myDefFlagEx(st, Qt::WindowActive, name, "Act");
-    if (name.isEmpty()) name = QLatin1String("None");
-    dbg.nospace() << "WindowState(" << QDbgStr(name) << ")";
+    if (name.isEmpty()) name = "None";
+    dbg.nospace() << "WindowState(" << name.constData() << ")";
     return dbg.space();
 }
@@ -50,5 +26,5 @@
 QDebug operator<<(QDebug dbg, Qt::FocusReason r)
 {
-    QString name;
+    QByteArray name;
     if (r == Qt::MouseFocusReason) name = "Mouse";
     if (r == Qt::TabFocusReason) name = "Tab";
@@ -59,5 +35,5 @@
     if (r == Qt::MenuBarFocusReason) name = "MenuBar";
     if (r == Qt::OtherFocusReason) name = "Other";
-    dbg.nospace() << "FocusReason(" << QDbgStr(name) << ")";
+    dbg.nospace() << "FocusReason(" << name.constData() << ")";
     return dbg.space();
 }
@@ -80,5 +56,5 @@
     void paintEvent(QPaintEvent *aE)
     {
-        qDebug() << qWidgetName(this) << __FUNCTION__
+        qDebug() << this << __FUNCTION__
                  << ": " << aE->rect() << "focus" << hasFocus();
 
@@ -108,5 +84,5 @@
     void focusInEvent(QFocusEvent *aE)
     {
-        qDebug() << qWidgetName(this) << __FUNCTION__ << ": reason" << aE->reason();
+        qDebug() << this << __FUNCTION__ << ": reason" << aE->reason();
         QWidget::focusInEvent(aE);
     }
@@ -114,5 +90,5 @@
     void focusOutEvent(QFocusEvent *aE)
     {
-        qDebug() << qWidgetName(this) << __FUNCTION__ << ": reason" << aE->reason();
+        qDebug() << this << __FUNCTION__ << ": reason" << aE->reason();
         QWidget::focusOutEvent(aE);
     }
@@ -140,8 +116,7 @@
     void focusInEvent(QFocusEvent *aE)
     {
-        qDebug() << qWidgetName(this) << __FUNCTION__ << ":" << text()
+        qDebug() << this << __FUNCTION__ << ":" << text()
                  << "reason" << aE->reason()
-                 << "focus" << (qApp->focusWidget() ?
-                    qWidgetName(qApp->focusWidget()) : QDbgStr(QLatin1String("<none>")));
+                 << "focus" << qApp->focusWidget();
 
         QPushButton::focusInEvent(aE);
@@ -150,8 +125,7 @@
     void focusOutEvent(QFocusEvent *aE)
     {
-        qDebug() << qWidgetName(this) << __FUNCTION__ << ":" << text()
+        qDebug() << this << __FUNCTION__ << ":" << text()
                  << "reason" << aE->reason()
-                 << "focus" << (qApp->focusWidget() ?
-                    qWidgetName(qApp->focusWidget()) : QDbgStr(QLatin1String("<none>")));
+                 << "focus" << qApp->focusWidget();
         QPushButton::focusOutEvent(aE);
     }
@@ -171,8 +145,7 @@
     void focusInEvent(QFocusEvent *aE)
     {
-        qDebug() << qWidgetName(this) << __FUNCTION__ << ":" << currentText()
+        qDebug() << this << __FUNCTION__ << ":" << currentText()
                  << "reason" << aE->reason()
-                 << "focus" << (qApp->focusWidget() ?
-                    qWidgetName(qApp->focusWidget()) : QDbgStr(QLatin1String("<none>")));
+                 << "focus" << qApp->focusWidget();
         QComboBox::focusInEvent(aE);
     }
@@ -180,8 +153,7 @@
     void focusOutEvent(QFocusEvent *aE)
     {
-        qDebug() << qWidgetName(this) << __FUNCTION__ << ":" << currentText()
+        qDebug() << this << __FUNCTION__ << ":" << currentText()
                  << "reason" << aE->reason()
-                 << "focus" << (qApp->focusWidget() ?
-                    qWidgetName(qApp->focusWidget()) : QDbgStr(QLatin1String("<none>")));
+                 << "focus" << qApp->focusWidget();
         QComboBox::focusOutEvent(aE);
     }
@@ -218,6 +190,6 @@
     {
         qDebug() << __FUNCTION__ << ": btn" << aE->button()
-                 << QDbgStr(QString().sprintf("btns %08X mods %08X",
-                                              (int) aE->buttons(), (int) aE->modifiers()))
+                 << "btns" << qDebugFmtHex(aE->buttons())
+                 << "mods" << qDebugFmtHex(aE->modifiers())
                  << "gpos" << aE->globalPos() << "pos" << aE->pos();
         QComboBox::mousePressEvent(aE);
@@ -227,6 +199,6 @@
     {
         qDebug() << __FUNCTION__ << ": btn" << aE->button()
-                 << QDbgStr(QString().sprintf("btns %08X mods %08X",
-                                              (int) aE->buttons(), (int) aE->modifiers()))
+                 << "btns" << qDebugFmtHex(aE->buttons())
+                 << "mods" << qDebugFmtHex(aE->modifiers())
                  << "gpos" << aE->globalPos() << "pos" << aE->pos();
         QComboBox::mouseReleaseEvent(aE);
@@ -371,5 +343,5 @@
     void focusInEvent(QFocusEvent *aE)
     {
-        qDebug() << qWidgetName(this) << __FUNCTION__ << ": reason" << aE->reason();
+        qDebug() << this << __FUNCTION__ << ": reason" << aE->reason();
         QWidget::focusInEvent(aE);
     }
@@ -377,5 +349,5 @@
     void focusOutEvent(QFocusEvent *aE)
     {
-        qDebug() << qWidgetName(this) << __FUNCTION__ << ": reason" << aE->reason();
+        qDebug() << this << __FUNCTION__ << ": reason" << aE->reason();
         QWidget::focusOutEvent(aE);
     }
@@ -401,20 +373,22 @@
     void keyPressEvent(QKeyEvent *aE)
     {
-        qDebug() << __FUNCTION__ << "  : cnt" << aE->count()
-                 << "rep" << aE->isAutoRepeat()
-                 << QDbgStr(QString().sprintf("key %08X mods %08X", aE->key(), (int) aE->modifiers()))
-                 << "text" << aE->text()
-                 << QDbgStr(aE->text().isEmpty() ? QString() :
-                            QString().sprintf("(%04X)", aE->text()[0].unicode()));
-    }
-
-    void keyReleaseEvent(QKeyEvent *aE)
-    {
         qDebug() << __FUNCTION__ << ": cnt" << aE->count()
                  << "rep" << aE->isAutoRepeat()
-                 << QDbgStr(QString().sprintf("key %08X mods %08X", aE->key(), (int) aE->modifiers()))
+                 << "key" << qDebugFmtHex(aE->key())
+                 << "mods" << qDebugFmtHex(aE->modifiers())
                  << "text" << aE->text()
-                 << QDbgStr(aE->text().isEmpty() ? QString() :
-                            QString().sprintf("(%04X)", aE->text()[0].unicode()));
+                 << qDebugFmtHex((aE->text().isEmpty() ? 0 :
+                                  aE->text()[0].unicode()));
+    }
+
+    void keyReleaseEvent(QKeyEvent *aE)
+    {
+        qDebug() << __FUNCTION__ << ": cnt" << aE->count()
+                 << "rep" << aE->isAutoRepeat()
+                 << "key" << qDebugFmtHex(aE->key())
+                 << "mods" << qDebugFmtHex(aE->modifiers())
+                 << "text" << aE->text()
+                 << qDebugFmtHex((aE->text().isEmpty() ? 0 :
+                                  aE->text()[0].unicode()));
     }
 #endif
@@ -438,6 +412,6 @@
     {
         qDebug() << __FUNCTION__ << ": btn" << aE->button()
-                 << QDbgStr(QString().sprintf("btns %08X mods %08X",
-                                              (int) aE->buttons(), (int) aE->modifiers()))
+                 << "btns" << qDebugFmtHex(aE->buttons())
+                 << "mods" << qDebugFmtHex(aE->modifiers())
                  << "gpos" << aE->globalPos() << "pos" << aE->pos();
 
@@ -449,6 +423,6 @@
     {
         qDebug() << __FUNCTION__ << ": btn" << aE->button()
-                 << QDbgStr(QString().sprintf("btns %08X mods %08X",
-                                              (int) aE->buttons(), (int) aE->modifiers()))
+                 << "btns" << qDebugFmtHex(aE->buttons())
+                 << "mods" << qDebugFmtHex(aE->modifiers())
                  << "gpos" << aE->globalPos() << "pos" << aE->pos();
     }
@@ -457,6 +431,6 @@
     {
         qDebug() << __FUNCTION__ << ": btn" << aE->button()
-                 << QDbgStr(QString().sprintf("btns %08X mods %08X",
-                                              (int) aE->buttons(), (int) aE->modifiers()))
+                 << "btns" << qDebugFmtHex(aE->buttons())
+                 << "mods" << qDebugFmtHex(aE->modifiers())
                  << "gpos" << aE->globalPos() << "pos" << aE->pos();
     }
@@ -509,6 +483,6 @@
             QMouseEvent *me = static_cast<QMouseEvent*>(aE);
             qDebug() << this << aE->type() << ": btn" << me->button()
-                     << QDbgStr(QString().sprintf("btns %08X mods %08X",
-                                                  (int) me->buttons(), (int) me->modifiers()))
+                     << "btns" << qDebugFmtHex(me->buttons())
+                     << "mods" << qDebugFmtHex(me->modifiers())
                      << "gpos" << me->globalPos() << "pos" << me->pos();
             break;
@@ -568,4 +542,16 @@
 
 #if 1
+    //--------------------------------------------------------------------------
+    // Simple QProcess test
+    QProcess cmd;
+    QStringList params;
+    params << "/c" << "ver";
+    cmd.start("cmd", params, QIODevice::ReadOnly);
+    cmd.waitForStarted();
+    cmd.waitForFinished();
+    PRINT_EXPR(cmd.readAll());
+#endif
+
+#if 0
     //--------------------------------------------------------------------------
     // QFileInfo test
