summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2022-08-09 11:35:45 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-08-09 15:26:09 +0000
commit13197f4e8387cf23d7980c0a696a8ff9d71e4dee (patch)
treed69e998a5014ff3c91d32492c7ee498e73d96996
parentf3af9b8473bf775d9e449cfcec8e17960b3f75f3 (diff)
Add QT_NO_DEBUG_STREAM protections
So the header compiles with QDebug disabled. Change-Id: I0f89dee4ff07734d53eee4dc5e2183633ee05da1 Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit 5b3e299bf0ed9459ff57bc9f2119b38ef0e001d9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/pdf/qpdflink.cpp3
-rw-r--r--src/pdf/qpdflink.h4
2 files changed, 6 insertions, 1 deletions
diff --git a/src/pdf/qpdflink.cpp b/src/pdf/qpdflink.cpp
index 6429f9f75..d1f5bdfdc 100644
--- a/src/pdf/qpdflink.cpp
+++ b/src/pdf/qpdflink.cpp
@@ -5,6 +5,7 @@
#include "qpdflink_p.h"
#include "qpdflinkmodel_p.h"
#include <QGuiApplication>
+#include <QDebug>
QT_BEGIN_NAMESPACE
@@ -168,6 +169,7 @@ void QPdfLink::copyToClipboard(QClipboard::Mode mode) const
QGuiApplication::clipboard()->setText(toString(), mode);
}
+#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug dbg, const QPdfLink &link)
{
QDebugStateSaver saver(dbg);
@@ -181,6 +183,7 @@ QDebug operator<<(QDebug dbg, const QPdfLink &link)
dbg << ')';
return dbg;
}
+#endif
QT_END_NAMESPACE
diff --git a/src/pdf/qpdflink.h b/src/pdf/qpdflink.h
index 637801512..63389afe6 100644
--- a/src/pdf/qpdflink.h
+++ b/src/pdf/qpdflink.h
@@ -5,7 +5,6 @@
#define QPDFLINK_H
#include <QtPdf/qtpdfglobal.h>
-#include <QtCore/qdebug.h>
#include <QtCore/qlist.h>
#include <QtCore/qobject.h>
#include <QtCore/qpoint.h>
@@ -15,6 +14,7 @@
QT_BEGIN_NAMESPACE
+class QDebug;
class QPdfLinkPrivate;
class QPdfLink
@@ -67,7 +67,9 @@ private: // storage
};
Q_DECLARE_SHARED(QPdfLink)
+#ifndef QT_NO_DEBUG_STREAM
Q_PDF_EXPORT QDebug operator<<(QDebug, const QPdfLink &);
+#endif
QT_END_NAMESPACE