OSDN Git Service

replace QT_DEBUG with QT_NO_DEBUG
authorIvailo Monev <xakepa10@laimg.moc>
Thu, 19 Dec 2019 00:30:42 +0000 (00:30 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Thu, 19 Dec 2019 00:30:42 +0000 (00:30 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
21 files changed:
src/core/global/qglobal.h.cmake
src/core/kernel/qcoreapplication.cpp
src/core/kernel/qobject.cpp
src/core/tools/qregexp.cpp
src/dbus/qdbusargument.cpp
src/gui/graphicsview/qgraph_p.h
src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
src/gui/graphicsview/qgraphicsanchorlayout_p.h
src/gui/graphicsview/qgraphicsgridlayout.cpp
src/gui/graphicsview/qgraphicslayout_p.cpp
src/gui/graphicsview/qgraphicslayout_p.h
src/gui/graphicsview/qgraphicslinearlayout.cpp
src/gui/graphicsview/qgridlayoutengine.cpp
src/gui/graphicsview/qgridlayoutengine_p.h
src/gui/graphicsview/qsimplex_p.cpp
src/gui/graphicsview/qsimplex_p.h
src/gui/kernel/qapplication_x11.cpp
src/gui/kernel/qlayout.cpp
src/gui/kernel/qwidget_x11.cpp
src/gui/widgets/qstatusbar.cpp
src/network/access/qnetworkaccesscache.cpp

index 527d313..c76ca81 100644 (file)
@@ -720,10 +720,6 @@ Q_CORE_EXPORT bool qSharedBuild();
    Debugging and error handling
 */
 
-#if !defined(QT_NO_DEBUG) && !defined(QT_DEBUG)
-#  define QT_DEBUG
-#endif
-
 #if (defined(QT_NO_DEBUG_OUTPUT) || defined(QT_NO_TEXTSTREAM)) && !defined(QT_NO_DEBUG_STREAM)
 #define QT_NO_DEBUG_STREAM
 #endif
index ef6f387..746d559 100644 (file)
@@ -1251,7 +1251,7 @@ void QCoreApplication::removePostedEvents(QObject *receiver, int eventType)
         }
     }
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
     if (receiver && eventType == 0) {
         Q_ASSERT(!receiver->d_func()->postedEvents);
     }
@@ -1288,7 +1288,7 @@ void QCoreApplicationPrivate::removePostedEvent(QEvent * event)
     QMutexLocker locker(&data->postEventList.mutex);
 
     if (data->postEventList.size() == 0) {
-#if defined(QT_DEBUG)
+#ifndef QT_NO_DEBUG
         qDebug("QCoreApplication::removePostedEvent: Internal error: %p %d is posted",
                 (void*)event, event->type());
         return;
index e69d57f..0adcbc6 100644 (file)
@@ -3223,7 +3223,7 @@ QList<QByteArray> QObject::dynamicPropertyNames() const
 
 static void dumpRecursive(int level, QObject *object)
 {
-#if defined(QT_DEBUG)
+#ifndef QT_NO_DEBUG
     if (object) {
         QByteArray buf;
         buf.fill(' ', level / 2 * 8);
@@ -3255,7 +3255,7 @@ static void dumpRecursive(int level, QObject *object)
 #else
     Q_UNUSED(level)
     Q_UNUSED(object)
-#endif
+#endif // QT_NO_DEBUG
 }
 
 /*!
@@ -3286,7 +3286,7 @@ void QObject::dumpObjectTree()
 
 void QObject::dumpObjectInfo()
 {
-#if defined(QT_DEBUG)
+#ifndef QT_NO_DEBUG
     qDebug("OBJECT %s::%s", metaObject()->className(),
            objectName().isEmpty() ? "unnamed" : objectName().toLocal8Bit().data());
 
@@ -3350,7 +3350,7 @@ void QObject::dumpObjectInfo()
     } else {
         qDebug("        <None>");
     }
-#endif
+#endif // QT_NO_DEBUG
 }
 
 #ifndef QT_NO_DEBUG_STREAM
index 84379d8..685d553 100644 (file)
@@ -1032,7 +1032,7 @@ public:
     const QVector<int> &firstOccurrence() const { return occ1; }
 #endif
 
-#if defined(QT_DEBUG)
+#ifndef QT_NO_DEBUG
     void dump() const;
 #endif
 
@@ -1101,7 +1101,7 @@ public:
     void heuristicallyChooseHeuristic();
 #endif
 
-#if defined(QT_DEBUG)
+#ifndef QT_NO_DEBUG
     void dump() const;
 #endif
 
@@ -1214,7 +1214,7 @@ private:
         void setupHeuristics();
 #endif
 
-#if defined(QT_DEBUG)
+#ifndef QT_NO_DEBUG
         void dump() const;
 #endif
 
@@ -1632,7 +1632,7 @@ void QRegExpEngine::heuristicallyChooseHeuristic()
 }
 #endif
 
-#if defined(QT_DEBUG)
+#ifndef QT_NO_DEBUG
 void QRegExpEngine::dump() const
 {
     int i, j;
@@ -2428,7 +2428,7 @@ bool QRegExpCharClass::in(QChar ch) const
     return n;
 }
 
-#if defined(QT_DEBUG)
+#ifndef QT_NO_DEBUG
 void QRegExpCharClass::dump() const
 {
     int i;
@@ -2689,7 +2689,7 @@ void QRegExpEngine::Box::setupHeuristics()
 }
 #endif
 
-#if defined(QT_DEBUG)
+#ifndef QT_NO_DEBUG
 void QRegExpEngine::Box::dump() const
 {
     int i;
index 79318d5..8576fed 100644 (file)
@@ -121,7 +121,7 @@ bool QDBusArgumentPrivate::checkWrite(QDBusArgumentPrivate *&d)
         return true;
     }
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
     qFatal("QDBusArgument: write from a read-only object");
 #else
     qWarning("QDBusArgument: write from a read-only object");
@@ -136,7 +136,7 @@ bool QDBusArgumentPrivate::checkRead(QDBusArgumentPrivate *d)
     if (d->direction == Demarshalling)
         return true;
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
     qFatal("QDBusArgument: read from a write-only object");
 #else
     qWarning("QDBusArgument: read from a write-only object");
index 4a9fcb7..c951482 100644 (file)
@@ -140,7 +140,7 @@ public:
     {
         // Creates a bidirectional edge
         if (edgeData(first, second)) {
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
             qWarning("%s-%s already has an edge", qPrintable(first->toString()), qPrintable(second->toString()));
 #endif
         }
@@ -198,7 +198,7 @@ public:
         return conns;
     }
 
-#if defined(QT_DEBUG)
+#ifndef QT_NO_DEBUG
     QString serializeToDot() {   // traversal
         QString strVertices;
         QString edges;
@@ -227,7 +227,7 @@ public:
         }
         return QString::fromAscii("%1\n%2\n").arg(strVertices).arg(edges);
     }
-#endif
+#endif // QT_NO_DEBUG
 
 protected:
     void createDirectedEdge(Vertex *from, Vertex *to, EdgeData *data)
index 6769545..beb9b64 100644 (file)
@@ -45,7 +45,7 @@
 #include <QtCore/qstack.h>
 #include <QtCore/qqueue.h>
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
 #include <QtCore/qfile.h>
 #endif
 
@@ -559,7 +559,7 @@ void SequentialAnchorData::calculateSizeHints()
     sizeAtMaximum = prefSize;
 }
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
 void AnchorData::dump(int indent) {
     if (type == Parallel) {
         qDebug("%*s type: parallel:", indent, "");
@@ -607,7 +607,7 @@ QSimplexConstraint *GraphPath::constraint(const GraphPath &path) const
     return c;
 }
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
 QString GraphPath::toString() const
 {
     QString string(QLatin1String("Path: "));
@@ -867,7 +867,7 @@ bool QGraphicsAnchorLayoutPrivate::replaceVertex(Orientation orientation, Anchor
         AnchorData *ad = edges[i];
         AnchorVertex *otherV = replaceVertex_helper(ad, oldV, newV);
 
-#if defined(QT_DEBUG)
+#ifndef QT_NO_DEBUG
         ad->name = QString::fromAscii("%1 --to--> %2").arg(ad->from->toString()).arg(ad->to->toString());
 #endif
 
@@ -1730,7 +1730,7 @@ void QGraphicsAnchorLayoutPrivate::addAnchor_helper(QGraphicsLayoutItem *firstIt
     // so we still know that the anchor direction is from 1 to 2.
     data->from = v1;
     data->to = v2;
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
     data->name = QString::fromAscii("%1 --to--> %2").arg(v1->toString()).arg(v2->toString());
 #endif
     // ### bit to track internal anchors, since inside AnchorData methods
@@ -2073,7 +2073,7 @@ QList<AnchorData *> getVariables(const QList<QSimplexConstraint *> &constraints)
 void QGraphicsAnchorLayoutPrivate::calculateGraphs(
     QGraphicsAnchorLayoutPrivate::Orientation orientation)
 {
-#if defined(QT_DEBUG) || defined(Q_AUTOTEST_EXPORT)
+#if !defined(QT_NO_DEBUG) || defined(Q_AUTOTEST_EXPORT)
     lastCalculationUsedSimplex[orientation] = false;
 #endif
 
@@ -2237,7 +2237,7 @@ bool QGraphicsAnchorLayoutPrivate::calculateTrunk(Orientation orientation, const
         sizeHints[orientation][Qt::MaximumSize] = ad->sizeAtMaximum;
     }
 
-#if defined(QT_DEBUG) || defined(Q_AUTOTEST_EXPORT)
+#if !defined(QT_NO_DEBUG) || defined(Q_AUTOTEST_EXPORT)
     lastCalculationUsedSimplex[orientation] = needsSimplex;
 #endif
 
@@ -2960,7 +2960,7 @@ bool QGraphicsAnchorLayoutPrivate::hasConflicts() const
     return graphHasConflicts[0] || graphHasConflicts[1] || floatConflict;
 }
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
 void QGraphicsAnchorLayoutPrivate::dumpGraph(const QString &name)
 {
     QFile file(QString::fromAscii("anchorlayout.%1.dot").arg(name));
index 1c61e88..98e316a 100644 (file)
@@ -82,7 +82,7 @@ struct AnchorVertex {
     AnchorVertex()
         : m_item(0), m_edge(Qt::AnchorPoint(0)), m_type(Normal) {}
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
     inline QString toString() const;
 #endif
 
@@ -127,7 +127,7 @@ struct AnchorData : public QSimplexVariable {
     virtual void updateChildrenSizes() {}
     void refreshSizeHints(const QLayoutStyleInfo *styleInfo = 0);
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
     void dump(int indent = 2);
     inline QString toString() const;
     QString name;
@@ -171,7 +171,7 @@ struct AnchorData : public QSimplexVariable {
     uint orientation;
 };
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
 inline QString AnchorData::toString() const
 {
     return QString::fromAscii("Anchor(%1)").arg(name);
@@ -185,7 +185,7 @@ struct SequentialAnchorData : public AnchorData
     {
         type = AnchorData::Sequential;
         orientation = m_edges.at(0)->orientation;
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
         name = QString::fromAscii("%1 -- %2").arg(vertices.first()->toString(), vertices.last()->toString());
 #endif
     }
@@ -213,7 +213,7 @@ struct ParallelAnchorData : public AnchorData
         // direction as the first anchor.
         from = first->from;
         to = first->to;
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
         name = QString::fromAscii("%1 | %2").arg(first->toString(), second->toString());
 #endif
     }
@@ -249,7 +249,7 @@ struct AnchorVertexPair : public AnchorVertex {
     QList<AnchorData *> m_secondAnchors;
 };
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
 inline QString AnchorVertex::toString() const
 {
     if (m_type == Pair) {
@@ -312,7 +312,7 @@ public:
     GraphPath() {}
 
     QSimplexConstraint *constraint(const GraphPath &path) const;
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
     QString toString() const;
 #endif
     QSet<AnchorData *> positives;
@@ -525,7 +525,7 @@ public:
                         const QList<AnchorData *> &variables);
     bool hasConflicts() const;
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
     void dumpGraph(const QString &name = QString());
 #endif
 
@@ -566,7 +566,7 @@ public:
     bool graphHasConflicts[2];
     QSet<QGraphicsLayoutItem *> m_floatItems[2];
 
-#if defined(QT_DEBUG) || defined(Q_AUTOTEST_EXPORT)
+#if !defined(QT_NO_DEBUG) || defined(Q_AUTOTEST_EXPORT)
     bool lastCalculationUsedSimplex[2];
 #endif
 
index 2634f56..ac0613d 100644 (file)
@@ -101,7 +101,7 @@ public:
     QLayoutStyleInfo styleInfo() const;
 
     QGridLayoutEngine engine;
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
     void dump(int indent) const;
 #endif
 };
@@ -622,7 +622,7 @@ void QGraphicsGridLayout::invalidate()
     QGraphicsLayout::invalidate();
 }
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
 void QGraphicsGridLayoutPrivate::dump(int indent) const
 {
     if (qt_graphicsLayoutDebug()) {
@@ -647,7 +647,7 @@ void QGraphicsGridLayout::setGeometry(const QRectF &rect)
         qSwap(left, right);
     effectiveRect.adjust(+left, +top, -right, -bottom);
     d->engine.setGeometries(d->styleInfo(), effectiveRect);
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
     if (qt_graphicsLayoutDebug()) {
         static int counter = 0;
         qDebug("==== BEGIN DUMP OF QGraphicsGridLayout (%d)====", counter++);
index 0c22071..c0946da 100644 (file)
@@ -71,7 +71,7 @@ void QGraphicsLayoutPrivate::reparentChildItems(QGraphicsItem *newParent)
             l->d_func()->reparentChildItems(newParent);
         } else if (QGraphicsItem *itemChild = layoutChild->graphicsItem()){
             QGraphicsItem *childParent = itemChild->parentItem();
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
             if (childParent && childParent != newParent && itemChild->isWidget() && qt_graphicsLayoutDebug()) {
                 QGraphicsWidget *w = static_cast<QGraphicsWidget*>(layoutChild);
                 qWarning("QGraphicsLayout::addChildLayout: widget %s \"%s\" in wrong parent; moved to correct parent",
@@ -163,7 +163,7 @@ void QGraphicsLayoutPrivate::addChildLayoutItem(QGraphicsLayoutItem *layoutItem)
             if (oldParent == newParent || !newParent)
                 return;
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
             if (oldParent && item->isWidget()) {
                 QGraphicsWidget *w = static_cast<QGraphicsWidget*>(item);
                 qWarning("QGraphicsLayout::addChildLayoutItem: %s \"%s\" in wrong parent; moved to correct parent",
index 1acfe84..e87ea05 100644 (file)
@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
 class QGraphicsLayoutItem;
 class QGraphicsWidget;
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
 inline bool qt_graphicsLayoutDebug()
 {
     static int checked_env = -1;
index 9e13846..8d7a374 100644 (file)
 #include "qgraphicslinearlayout.h"
 #include "qgraphicswidget.h"
 #include "qgridlayoutengine_p.h"
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
 #include <QtCore/qdebug.h>
 #endif
 #include "qguicommon_p.h"
@@ -503,7 +503,7 @@ void QGraphicsLinearLayout::setGeometry(const QRectF &rect)
     if (visualDir == Qt::RightToLeft)
         qSwap(left, right);
     effectiveRect.adjust(+left, +top, -right, -bottom);
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
     if (qt_graphicsLayoutDebug()) {
         static int counter = 0;
         qDebug() << counter++ << "QGraphicsLinearLayout::setGeometry - " << rect;
@@ -511,7 +511,7 @@ void QGraphicsLinearLayout::setGeometry(const QRectF &rect)
     }
 #endif
     d->engine.setGeometries(d->styleInfo(), effectiveRect);
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
     if (qt_graphicsLayoutDebug()) {
         qDebug() << "post dump";
         dump(1);
@@ -546,7 +546,7 @@ void QGraphicsLinearLayout::invalidate()
 */
 void QGraphicsLinearLayout::dump(int indent) const
 {
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
     if (qt_graphicsLayoutDebug()) {
         Q_D(const QGraphicsLinearLayout);
         qDebug("%*s%s layout", indent, "",
index 4bb8411..ea23467 100644 (file)
@@ -139,7 +139,7 @@ void QGridLayoutBox::normalize()
     Q_ASSERT((q_minimumDescent < 0.0) == (q_minimumAscent < 0.0));
 }
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
 void QGridLayoutBox::dump(int indent) const
 {
     qDebug("%*sBox (%g <= %g <= %g [%g/%g])", indent, "", q_minimumSize, q_preferredSize,
@@ -463,7 +463,7 @@ void QGridLayoutRowData::stealBox(int start, int end, int which, qreal *position
     }
 }
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
 void QGridLayoutRowData::dump(int indent) const
 {
     qDebug("%*sData", indent, "");
@@ -759,7 +759,7 @@ QSizeF QGridLayoutItem::effectiveMaxSize(const QSizeF &constraint) const
     return size;
 }
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
 void QGridLayoutItem::dump(int indent) const
 {
     qDebug("%*s%p (%d, %d) %d x %d", indent, "", q_layoutItem, firstRow(), firstColumn(),
@@ -786,7 +786,7 @@ void QGridLayoutRowInfo::insertOrRemoveRows(int row, int delta)
     insertOrRemoveItems(boxes, row, delta);
 }
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
 void QGridLayoutRowInfo::dump(int indent) const
 {
     qDebug("%*sInfo (count: %d)", indent, "", count);
@@ -1255,7 +1255,7 @@ Qt::LayoutDirection QGridLayoutEngine::visualDirection() const
     return m_visualDirection;
 }
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
 void QGridLayoutEngine::dump(int indent) const
 {
     qDebug("%*sEngine", indent, "");
index 19766e9..9d6acd4 100644 (file)
@@ -139,7 +139,7 @@ public:
     void combine(const QGridLayoutBox &other);
     void normalize();
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
     void dump(int indent = 0) const;
 #endif
     // This code could use the union-struct-array trick, but a compiler
@@ -229,7 +229,7 @@ public:
     QGridLayoutBox totalBox(int start, int end) const;
     void stealBox(int start, int end, int which, qreal *positions, qreal *sizes);
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
     void dump(int indent = 0) const;
 #endif
 
@@ -290,7 +290,7 @@ public:
     void insertOrRemoveRows(int row, int delta, Qt::Orientation orientation = Qt::Vertical);
     QSizeF effectiveMaxSize(const QSizeF &constraint) const;
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
     void dump(int indent = 0) const;
 #endif
 
@@ -310,7 +310,7 @@ public:
 
     void insertOrRemoveRows(int row, int delta);
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
     void dump(int indent = 0) const;
 #endif
 
@@ -393,7 +393,7 @@ public:
     void transpose();
     void setVisualDirection(Qt::LayoutDirection direction);
     Qt::LayoutDirection visualDirection() const;
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
     void dump(int indent = 0) const;
 #endif
 
index 8c9ea84..c05ea3a 100644 (file)
@@ -543,7 +543,7 @@ qreal QSimplex::solver(solverFactor factor)
     solveMaxHelper();
     collectResults();
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
     for (int i = 0; i < constraints.size(); ++i) {
         Q_ASSERT(constraints[i]->isSatisfied());
     }
index 6270daa..904bfd7 100644 (file)
@@ -112,7 +112,7 @@ struct QSimplexConstraint
         }
     }
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
     QString toString() {
         QString result;
         result += QString::fromAscii("-- QSimplexConstraint %1 --").arg(quintptr(this), 0, 16);
@@ -135,7 +135,7 @@ struct QSimplexConstraint
 
         return result;
     }
-#endif
+#endif // QT_NO_DEBUG
 };
 
 class QSimplex
index 3489f70..fbeee08 100644 (file)
@@ -276,7 +276,7 @@ static const char *appFont = 0;                         // application font
 static const char *mwGeometry = 0;                      // main widget geometry
 static const char *mwTitle = 0;                         // main widget title
 static bool        appSync = false;                     // X11 synchronization
-#if defined(QT_DEBUG)
+#ifndef QT_NO_DEBUG
 static bool        appNoGrab = false;                   // X11 grabbing enabled
 static bool        appDoGrab = false;                   // X11 grabbing override (gdb)
 #endif
@@ -1109,7 +1109,7 @@ static void getXDefault(const char *group, const char *key, bool *val)
 }
 #endif
 
-#if defined(QT_DEBUG) && defined(Q_OS_LINUX)
+#if !defined(QT_NO_DEBUG) && defined(Q_OS_LINUX)
 // Find out if our parent process is gdb by looking at the 'exe' symlink under /proc,.
 // or, for older Linuxes, read out 'cmdline'.
 bool runningUnderDebugger()
@@ -1306,7 +1306,7 @@ void qt_init(QApplicationPrivate *priv, int,
         }
         else if (arg == "-sync")
             appSync = !appSync;
-#if defined(QT_DEBUG)
+#ifndef QT_NO_DEBUG
         else if (arg == "-nograb")
             appNoGrab = !appNoGrab;
         else if (arg == "-dograb")
@@ -1318,7 +1318,7 @@ void qt_init(QApplicationPrivate *priv, int,
 
     priv->argc = j;
 
-#if defined(QT_DEBUG) && defined(Q_OS_LINUX)
+#if !defined(QT_NO_DEBUG) && defined(Q_OS_LINUX)
     if (!appNoGrab && !appDoGrab && runningUnderDebugger()) {
         appNoGrab = true;
         qDebug("Qt: gdb: -nograb added to command-line options.\n"
@@ -1755,7 +1755,7 @@ const char *QX11Info::appClass()                                // get applicati
 
 bool qt_nograb()                                // application no-grab option
 {
-#if defined(QT_DEBUG)
+#ifndef QT_NO_DEBUG
     return appNoGrab;
 #else
     return false;
index fbf9b4b..5c6d64b 100644 (file)
@@ -817,7 +817,7 @@ bool QLayout::adoptLayout(QLayout *layout)
     return ok;
 }
 
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
 static bool layoutDebug()
 {
     static int checked_env = -1;
@@ -843,7 +843,7 @@ void QLayoutPrivate::reparentChildWidgets(QWidget *mw)
         QLayoutItem *item = q->itemAt(i);
         if (QWidget *w = item->widget()) {
             QWidget *pw = w->parentWidget();
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
             if (pw && pw != mw && layoutDebug()) {
                 qWarning("QLayout::addChildLayout: widget %s \"%s\" in wrong parent; moved to correct parent",
                          w->metaObject()->className(), w->objectName().toLocal8Bit().data());
@@ -878,7 +878,7 @@ void QLayout::addChildWidget(QWidget *w)
     if (pw && w->testAttribute(Qt::WA_LaidOut)) {
         QLayout *l = pw->layout();
         if (l && removeWidgetRecursively(l, w)) {
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
             if (layoutDebug())
                 qWarning("QLayout::addChildWidget: %s \"%s\" is already in a layout; moved to new layout",
                          w->metaObject()->className(), w->objectName().toLocal8Bit().data());
@@ -886,7 +886,7 @@ void QLayout::addChildWidget(QWidget *w)
         }
     }
     if (pw && mw && pw != mw) {
-#ifdef QT_DEBUG
+#ifndef QT_NO_DEBUG
             if (layoutDebug())
                 qWarning("QLayout::addChildWidget: %s \"%s\" in wrong parent; moved to correct parent",
                          w->metaObject()->className(), w->objectName().toLocal8Bit().data());
index b47f3b2..5b4b9be 100644 (file)
@@ -1342,7 +1342,7 @@ qstring_to_xtp(const QString& s)
         tl[0] = mapped.data();
         tl[1] = 0;
         errCode = XmbTextListToTextProperty(qt_x11Data->display, tl, 1, XStdICCTextStyle, &tp);
-#if defined(QT_DEBUG)
+#ifndef QT_NO_DEBUG
         if (errCode < 0)
             qDebug("qstring_to_xtp result code %d", errCode);
 #endif
index 3342b2d..dbd0290 100644 (file)
@@ -411,7 +411,7 @@ void QStatusBar::removeWidget(QWidget *widget)
 
     if (found)
         reformat();
-#if defined(QT_DEBUG)
+#ifndef QT_NO_DEBUG
     else
         qDebug("QStatusBar::removeWidget(): Widget not found.");
 #endif
index 7c282bf..5d1c4d1 100644 (file)
@@ -85,7 +85,7 @@ QNetworkAccessCache::CacheableObject::CacheableObject()
 
 QNetworkAccessCache::CacheableObject::~CacheableObject()
 {
-#if 0 //def QT_DEBUG
+#if 0 // ifndef QT_NO_DEBUG
     if (!key.isEmpty() && Ptr()->hasEntry(key))
         qWarning() << "QNetworkAccessCache: object" << (void*)this << "key" << key
                    << "destroyed without being removed from cache first!";