Ignore:
Timestamp:
Feb 26, 2010, 12:33:58 AM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: Cleaned up debug printing: get rid of qStr*() functions and use cross-platform qDebugFmt*() instead.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/kernel/qwidget_pm.cpp

    r603 r605  
    150150{
    151151#if defined(QT_DEBUGWIDGETMASK)
    152     qDebug("qt_WinInvalidateRegionEx: hwnd=%s hwndFrom=%08lX hwndTo=%08lX",
    153            qStrHWND(hwnd).toUtf8().constData(), hwndFrom, hwndTo);
     152    qDebug() << "qt_WinInvalidateRegionEx: hwnd" << qDebugHWND(hwnd)
     153             << "hwndFrom" << qDebugFmtHex(hwndFrom)
     154             << "hwndTo" << qDebugFmtHex(hwndTo);
    154155#endif
    155156
     
    179180        WinQueryWindowPos(child, &swp);
    180181#if defined(QT_DEBUGWIDGETMASK)
    181         qDebug(" child=%s [fl=%08lX]", qStrHWND(child).toUtf8().constData(),
    182                swp.fl);
     182        qDebug() << " child" << qDebugHWND(child) << "fl" << qDebugFmtHex(swp.fl);
    183183#endif
    184184        // proceed only if not hidden
     
    264264
    265265#if defined(QT_DEBUGWIDGETMASK)
    266     qDebug("qt_WinProcessWindowObstacles: hwnd=%s, prcl=%p "
    267            "hrgn=%08lX, op=%ld flags=%08lX",
    268            qStrHWND(hwnd).toUtf8().constData(), prcl, hrgn, op, flags);
     266    qDebug() << "qt_WinProcessWindowObstacles: hwnd" << qDebugHWND(hwnd)
     267             << "prcl" << prcl << "hrgn" << qDebugFmtHex(hrgn)
     268             << "op" << op << "flags" << qDebugFmtHex(flags);
    269269#endif
    270270
     
    316316                WinQueryWindowPos(relative, &swp);
    317317#if defined(QT_DEBUGWIDGETMASK)
    318                 qDebug(" child=%s [fl=%08lX]",
    319                        qStrHWND(relative).toUtf8().constData(), swp.fl);
     318                qDebug() << " child" << qDebugHWND(relative)
     319                         << "fl" << qDebugFmtHex(swp.fl);
    320320#endif
    321321                // skip if hidden
     
    356356            WinQueryWindowPos(relative, &swp);
    357357#if defined(QT_DEBUGWIDGETMASK)
    358             qDebug(" sibling=%s [fl=%08lX]",
    359                    qStrHWND(relative).toUtf8().constData(), swp.fl);
     358            qDebug() << " sibling" << qDebugHWND(relative)
     359                     << "fl" << qDebugFmtHex(swp.fl);
    360360#endif
    361361            // skip if hidden
     
    406406            WinQueryWindowPos(parent, &swp);
    407407#if defined(QT_DEBUGWIDGETMASK)
    408             qDebug(" parent=%s [fl=%08lX]",
    409                    qStrHWND(parent).toUtf8().constData(), swp.fl);
     408            qDebug() << " parent" << qDebugHWND(parent)
     409                     << "fl" << qDebugFmtHex(swp.fl);
    410410#endif
    411411            delta.x += swp.x;
     
    415415                WinQueryWindowPos(relative, &swp);
    416416#if defined(QT_DEBUGWIDGETMASK)
    417                 qDebug(" ancestor=%s [fl=%08lX]",
    418                        qStrHWND(relative).toUtf8().constData(), swp.fl);
     417                qDebug() << " ancestor" << qDebugHWND(relative)
     418                         << "fl" << qDebugFmtHex(swp.fl);
    419419#endif
    420420                // skip if hidden
     
    468468{
    469469#if defined(QT_DEBUGWIDGETMASK)
    470     qDebug("qt_WinSetWindowPos: hwnd=%s fl=%08lX",
    471            qStrHWND(hwnd).toUtf8().constData(), fl);
     470    qDebug() << "qt_WinSetWindowPos: hwnd" << qDebugHWND(hwnd)
     471             << "fl" << qDebugFmtHex(fl);
    472472#endif
    473473
     
    561561            }
    562562#if defined(QT_DEBUGWIDGETMASK)
    563             qDebug(" moving up? %ld", up);
    564             qDebug(" hwndFrom=%s", qStrHWND(hwndFrom).toUtf8().constData());
    565             qDebug(" hwndTo=%s", qStrHWND(hwndTo).toUtf8().constData());
     563            qDebug() << " moving up?" << up;
     564            qDebug() << " hwndFrom" << qDebugHWND(hwndFrom);
     565            qDebug() << " hwndTo" << qDebugHWND(hwndTo);
    566566#endif
    567567
     
    576576                    WinQueryWindowPos(sibling, &swp);
    577577#if defined(QT_DEBUGWIDGETMASK)
    578                     qDebug(" sibling=%s [fl=%08lX]",
    579                            qStrHWND(sibling).toUtf8().constData(), swp.fl);
     578                    qDebug() << " sibling" << qDebugHWND(sibling)
     579                             << "fl" << qDebugFmtHex(swp.fl);
    580580#endif
    581581                    // proceed only if not hidden
     
    607607                    WinQueryWindowPos(sibling, &swp);
    608608#if defined(QT_DEBUGWIDGETMASK)
    609                     qDebug(" sibling=%s [fl=%08lX]",
    610                            qStrHWND(sibling).toUtf8().constData(), swp.fl);
     609                    qDebug() << " sibling" << qDebugHWND(sibling)
     610                             << "fl" << qDebugFmtHex(swp.fl);
    611611#endif
    612612                    // proceed only if not hidden
     
    11381138            }
    11391139#if defined(QT_DEBUGWINCREATEDESTROY)
    1140             qDebug("|Creating top level window (frame) [%s]:\n"
    1141                    "|  owner = %08lX\n"
    1142                    "|  title = '%s'\n"
    1143                    "|  style = %08lX\n"
    1144                    "|  fcFlags = %08lX",
    1145                    qWidgetName(q).toUtf8().constData(), ownerw,
    1146                    title.constData(), fStyle, fcFlags);
     1140            qDebug() <<   "|Creating top level window (frame)" << q
     1141                     << "\n|  owner" << qDebugFmtHex(ownerw)
     1142                     << "\n|  title" << title
     1143                     << "\n|  style" << qDebugFmtHex(fStyle)
     1144                     << "\n|  fcFlags" << qDebugFmtHex(fcFlags);
    11471145#endif
    11481146            fId = WinCreateWindow(HWND_DESKTOP, WC_FRAME, title, fStyle,
     
    11501148                                  &fcData, NULL);
    11511149#if defined(QT_DEBUGWINCREATEDESTROY)
    1152             qDebug("|  hwnd = %08lX", fId);
     1150            qDebug() << "|  hwnd" << qDebugFmtHex(fId);
    11531151#endif
    11541152            if (fId == NULLHANDLE)
     
    11891187            // create client window
    11901188#if defined(QT_DEBUGWINCREATEDESTROY)
    1191             qDebug("|Creating top level window (client) [%s]:\n"
    1192                    "|  owner & parent = %08lX\n"
    1193                    "|  class = '%s'\n"
    1194                    "|  title = '%s'\n"
    1195                    "|  style = %08lX",
    1196                    qWidgetName(q).toUtf8().constData(), fId, className.constData(),
    1197                    title.constData(), style);
     1189            qDebug() <<   "|Creating top level window (client)" << q
     1190                     << "\n|  owner & parent" << qDebugFmtHex(fId)
     1191                     << "\n|  class" << className
     1192                     << "\n|  title" << title
     1193                     << "\n|  style" << qDebugFmtHex(style);
    11981194#endif
    11991195            // note that we place the client on top (HWND_TOP) to exclude other
     
    12031199        } else {
    12041200#if defined(QT_DEBUGWINCREATEDESTROY)
    1205             qDebug("|Creating top level window (popup) [%s]:\n"
    1206                    "|  class = '%s'\n"
    1207                    "|  title = '%s'\n"
    1208                    "|  style = %08lX",
    1209                    qWidgetName(q).toUtf8().constData(), className.constData(),
    1210                    title.constData(), style);
     1201            qDebug() <<   "|Creating top level window (popup)" << q
     1202                     << "\n|  class" << className
     1203                     << "\n|  title" << title
     1204                     << "\n|  style" << qDebugFmtHex(style);
    12111205#endif
    12121206            id = WinCreateWindow(HWND_DESKTOP, className, title, style,
     
    12141208        }
    12151209#if defined(QT_DEBUGWINCREATEDESTROY)
    1216         qDebug("|  hwnd = %08lX", id);
     1210        qDebug() << "|  hwnd" << qDebugFmtHex(id);
    12171211#endif
    12181212        if (id == NULLHANDLE)
     
    13271321
    13281322#if defined(QT_DEBUGWINCREATEDESTROY)
    1329         qDebug("|Creating child window [%s]:\n"
    1330                "|  owner & parent = %08lX\n"
    1331                "|  class = '%s'\n"
    1332                "|  title = '%s'\n"
    1333                "|  style = %08lX",
    1334                qWidgetName(q).toUtf8().constData(), parentw, className.constData(),
    1335                title.constData(), style);
     1323        qDebug() <<   "|Creating child window" << q
     1324                 << "/n|  owner & parent" << qDebugFmtHex(parentw)
     1325                 << "/n|  class" << className
     1326                 << "/n|  title" << title
     1327                 << "/n|  style" << qDebugFmtHex(style);
    13361328#endif
    13371329        id = WinCreateWindow(parentw, className, title, style,
     
    13421334                             parentw, HWND_TOP, 0, NULL, NULL);
    13431335#if defined(QT_DEBUGWINCREATEDESTROY)
    1344         qDebug("|  hwnd = %08lX", id);
     1336        qDebug() << "|  hwnd" << qDebugFmtHex(id);
    13451337#endif
    13461338        if (id == NULLHANDLE)
     
    14051397            }
    14061398#if defined(QT_DEBUGWINCREATEDESTROY)
    1407             qDebug("|Destroying window [%s]:\n"
    1408                    "|  hwnd = %08lX", qWidgetName(this).toUtf8().constData(), id);
    1409 #endif
    1410 
     1399            qDebug() << "|Destroying window" << this
     1400                     << "\n|  hwnd"  << qDebugFmtHex(id);
     1401#endif
    14111402            qt_WinDestroyWindow(id);
    14121403        }
Note: See TracChangeset for help on using the changeset viewer.