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/qwindowdefs_pm.h

    r603 r605  
    8686Q_GUI_EXPORT int qt_display_height();
    8787
    88 Q_GUI_EXPORT QWidget *qWidgetFromHWND(HWND hwnd);
     88Q_GUI_EXPORT QWidget *qt_widget_from_hwnd(HWND hwnd);
    8989
    90 // For printing non-quoted QString's with QDebug
    91 struct Q_CORE_EXPORT QDbgStr: public QString
    92 {
    93     inline QDbgStr(const QString &str) : QString(str) {}
    94 };
     90// QDebug helpers for debugging various API types
    9591
    96 Q_GUI_EXPORT QDbgStr qWidgetName(QWidget *w);
    97 inline QDbgStr qWidgetName(HWND hwnd)
    98 { return qWidgetName(qWidgetFromHWND(hwnd)); }
     92// don't drag qdebug.h but require it to be included first
     93#if defined(QDEBUG_H) && !defined(QT_NO_DEBUG_STREAM)
    9994
    100 Q_CORE_EXPORT QDbgStr qStrHWND(HWND hwnd);
    101 Q_CORE_EXPORT QDbgStr qStrHPS(HPS hps);
    102 Q_CORE_EXPORT QDbgStr qStrHPOINTER(HPOINTER hptr);
    103 Q_CORE_EXPORT QDbgStr qStrHRGN(HRGN hrgn);
    104 
    105 Q_CORE_EXPORT QDbgStr qStrQMSG(const QMSG &qmsg);
     95struct QDebugHWND { HWND hwnd; };
     96inline QDebugHWND qDebugHWND(HWND hwnd) { QDebugHWND d = { hwnd }; return d; }
     97QDebug operator<<(QDebug debug, const QDebugHWND &d);
    10698
    10799// the following declarations require OS/2 types not defined here,
    108 // we don't drag them in but require qt_os2.h to be included before
     100// don't drag them in as well but require qt_os2.h to be included first
    109101#if defined(QT_OS2_H)
    110102
    111 Q_CORE_EXPORT QDbgStr qStrRECTL(const RECTL &rcl);
    112 Q_CORE_EXPORT QDbgStr qStrSWP(const SWP &swp);
    113 
    114 #endif // defined(QT_OS2_H)
    115 
    116 // don't drag qdebug.h as well but require it to be included before
    117 #if defined(QDEBUG_H) && !defined(QT_NO_DEBUG_STREAM)
    118 
    119 // Prints a non-quoted QString
    120 inline QDebug operator<<(QDebug dbg, const QDbgStr &str)
    121 { dbg << str.toUtf8().constData(); return dbg; }
    122 
    123 #if defined(QT_OS2_H)
    124 
    125 inline QDebug operator<<(QDebug dbg, const RECTL &rcl)
    126 { dbg << qStrRECTL(rcl); return dbg; }
    127 
    128 inline QDebug operator<<(QDebug dbg, const SWP &swp)
    129 { dbg << qStrSWP(swp); return dbg; }
     103QDebug operator<<(QDebug debug, const RECTL &rcl);
     104QDebug operator<<(QDebug debug, const SWP &swp);
     105QDebug operator<<(QDebug debug, const QMSG &qmsg);
    130106
    131107#endif // defined(QT_OS2_H)
Note: See TracChangeset for help on using the changeset viewer.