summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2022-06-17 16:44:21 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2022-06-27 00:12:56 +0200
commit7466422e9ce964553dd09fce9f48437af7ec76c8 (patch)
treef727125120f9ff25fb72633be5645c6742b6f6c5 /src/gui
parent821aa1ff095ae66a89eb8725650dccac363f06ad (diff)
Add a way to declare _exported_ logging categories
If a library declares a logging category that needs to be used by clients (e.g. via inline methods, macros, etc.), then the logging category function generated by Q_DECLARE_LOGGING_CATEGORY has to be exported. We've seen this problem with Q_NAMESPACE, Q_GADGET, etc.: these macros also declare functions or objects that in some cases need to be exported. And precisely like Q_NAMESPACE, Q_GADGET, etc., people end up relying on the implementation details of Q_DECLARE_LOGGING_CATEGORY (specifically, what does it expand to) in order to place the export directives in the right place. Introduce a more robust solution and apply it around qtbase. Cleanup some minor code as a drive-by (remove `extern` and useless semicolons). [ChangeLog][QtCore][QLoggingCategory] Added the Q_DECLARE_EXPORTED_LOGGING_CATEGORY macro, in order to allow dynamic libraries to declare a logging category that can be then used by client code. Change-Id: I18f40cc937cfe8277b8d62ebc824c27a0773de04 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/opengl/qopenglprogrambinarycache_p.h2
-rw-r--r--src/gui/painting/qplatformbackingstore.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/opengl/qopenglprogrambinarycache_p.h b/src/gui/opengl/qopenglprogrambinarycache_p.h
index 0553121a22..0237c81fc5 100644
--- a/src/gui/opengl/qopenglprogrambinarycache_p.h
+++ b/src/gui/opengl/qopenglprogrambinarycache_p.h
@@ -28,7 +28,7 @@ QT_BEGIN_NAMESPACE
// therefore stay independent from QOpenGLShader(Program). Must rely only on
// QOpenGLContext/Functions.
-Q_GUI_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcOpenGLProgramDiskCache)
+Q_DECLARE_EXPORTED_LOGGING_CATEGORY(lcOpenGLProgramDiskCache, Q_GUI_EXPORT)
class Q_GUI_EXPORT QOpenGLProgramBinaryCache
{
diff --git a/src/gui/painting/qplatformbackingstore.h b/src/gui/painting/qplatformbackingstore.h
index a1bae50555..85bb0fe936 100644
--- a/src/gui/painting/qplatformbackingstore.h
+++ b/src/gui/painting/qplatformbackingstore.h
@@ -23,7 +23,7 @@
QT_BEGIN_NAMESPACE
-Q_GUI_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcQpaBackingStore)
+Q_DECLARE_EXPORTED_LOGGING_CATEGORY(lcQpaBackingStore, Q_GUI_EXPORT)
class QRegion;
class QRect;