diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2024-06-10 08:15:49 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2024-06-11 06:44:52 +0000 |
commit | 479c1e5baac753a71e3edb9929654b7e5705cb09 (patch) | |
tree | f6de03e7fa166b15262aa1b67165fde9ef55d4e6 /src | |
parent | 4f737256c0a698ff3ba380cbaef1ba80a16fc3a8 (diff) |
We should not rely on the internals of Q_LOGGING_CATEGORY to place the
'static' and we should make logging categories static where we can.
Since qlitehtml can be built against multiple versions of Qt, check for
the existence of Q_STATIC_LOGGING_CATEGORY before using it.
Task-number: QTBUG-67692
Change-Id: I75cb38f513a6d09fe3f85f3acc6d1360ed15bb63
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/container_qpainter.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/container_qpainter.cpp b/src/container_qpainter.cpp index ce5ade2..0afe4ef 100644 --- a/src/container_qpainter.cpp +++ b/src/container_qpainter.cpp @@ -29,9 +29,11 @@ const int kDragDistance = 5; using Font = QFont; using Context = QPainter; -namespace { +#ifdef Q_STATIC_LOGGING_CATEGORY +Q_STATIC_LOGGING_CATEGORY(log, "qlitehtml", QtCriticalMsg) +#else static Q_LOGGING_CATEGORY(log, "qlitehtml", QtCriticalMsg) -} +#endif static QFont toQFont(litehtml::uint_ptr hFont) { |