Skip to content

Commit a616f13

Browse files
committed
Compatibility with Qt5.x
1 parent 42e6c72 commit a616f13

14 files changed

+30
-7
lines changed

ChangeLog.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ All notable changes to this project will be documented in this file.
44
----
55
## [v1.6.0] - ??
66
### Improvements
7+
78
- Support for Qt6
89
- Minimum required Qt version is 5.12
910
- Add case sensitivity option in Stringmatchfilter
1011
- cmake: replace BUILD_STATIC_LOG4CXX_LIB with standard BUILD_SHARED_LIBS
1112

1213
### Fixed
14+
- Fixes for Qt6.7
1315
- Replace deprecated Qt 5.15 stuff
1416

1517
## [v1.5.1] - 14.02.2020

src/log4qt/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ set(log4qt_HEADERS
8080
hierarchy.h
8181
layout.h
8282
level.h
83+
log4qtdefs.h
8384
log4qt.h
8485
log4qtshared.h
8586
log4qtsharedptr.h

src/log4qt/appender.h

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#define LOG4QT_APPENDER_H
2323

2424
#include "layout.h"
25+
#include "log4qtdefs.h"
2526
#include "log4qtsharedptr.h"
2627
#include "spi/filter.h"
2728
#include "helpers/classlogger.h"

src/log4qt/basicconfigurator.h

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#ifndef LOG4QT_BASICCONFIGURATOR_H
2222
#define LOG4QT_BASICCONFIGURATOR_H
2323

24+
#include "log4qtdefs.h"
2425
#include "log4qt.h"
2526

2627
namespace Log4Qt

src/log4qt/helpers/configuratorhelper.h

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#ifndef LOG4QT_HELPERS_CONFIGURATORHELPER_H
2222
#define LOG4QT_HELPERS_CONFIGURATORHELPER_H
2323

24+
#include "log4qt/log4qtdefs.h"
2425
#include "log4qt/log4qtshared.h"
2526
#include "log4qt/loggingevent.h"
2627

src/log4qt/helpers/factory.h

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#ifndef LOG4QT_HELPERS_FACTORY_H
2222
#define LOG4QT_HELPERS_FACTORY_H
2323

24+
#include "log4qt/log4qtdefs.h"
2425
#include "log4qt/log4qtshared.h"
2526

2627
#include <QHash>

src/log4qt/helpers/initialisationhelper.h

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#ifndef LOG4QT_HELPERS_INITIALISATIONHELPER_H
2222
#define LOG4QT_HELPERS_INITIALISATIONHELPER_H
2323

24+
#include "log4qt/log4qtdefs.h"
2425
#include "log4qt/log4qtshared.h"
2526

2627
#include <QHash>

src/log4qt/helpers/optionconverter.h

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#ifndef LOG4QT_OPTIONCONVERTER_H
2222
#define LOG4QT_OPTIONCONVERTER_H
2323

24+
#include "log4qt/log4qtdefs.h"
2425
#include "log4qt/log4qtshared.h"
2526
#include "log4qt/level.h"
2627

src/log4qt/helpers/patternformatter.h

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#ifndef LOG4QT_PATTERNFORMATTER_H
2222
#define LOG4QT_PATTERNFORMATTER_H
2323

24+
#include "log4qt/log4qtdefs.h"
2425
#include "log4qt/log4qtshared.h"
2526

2627
#include <QList>

src/log4qt/layout.h

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#ifndef LOG4QT_LAYOUT_H
2222
#define LOG4QT_LAYOUT_H
2323

24+
#include "log4qtdefs.h"
2425
#include "log4qt.h"
2526
#include "log4qtsharedptr.h"
2627

src/log4qt/log4qt.h

-6
Original file line numberDiff line numberDiff line change
@@ -475,12 +475,6 @@
475475
# error "Log4Qt requires at least clang version 3.3 or higher for used c++11 features"
476476
#endif
477477

478-
// use Q_DISABLE_COPY for Qt version prior to 5.13.0
479-
#ifndef Q_DISABLE_COPY_MOVE
480-
#define Q_DISABLE_COPY_MOVE(Class) \
481-
Q_DISABLE_COPY(Class)
482-
#endif
483-
484478
/*
485479
LOG4QT_VERSION is (major << 16) + (minor << 8) + patch.
486480
*/

src/log4qt/log4qtdefs.h

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#ifndef LOG4QTDEFS_H
2+
#define LOG4QTDEFS_H
3+
4+
#include <QtGlobal>
5+
6+
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
7+
#include <QtClassHelperMacros>
8+
#endif
9+
10+
// use Q_DISABLE_COPY for Qt version prior to 5.13.0
11+
#ifndef Q_DISABLE_COPY_MOVE
12+
#define Q_DISABLE_COPY_MOVE(Class) \
13+
Q_DISABLE_COPY(Class)
14+
#endif
15+
16+
#endif // LOG4QTDEFS_H

src/log4qt/mdc.h

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#ifndef LOG4QT_MDC_H
2222
#define LOG4QT_MDC_H
2323

24+
#include "log4qtdefs.h"
2425
#include "log4qt.h"
2526

2627
#include <QString>

src/log4qt/ndc.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
#ifndef LOG4QT_NDC_H
2222
#define LOG4QT_NDC_H
2323

24-
#include "log4qt.h"
24+
#include "log4qtdefs.h"
25+
#include "log4qtshared.h"
2526

2627
#include <QString>
2728
#include <QStack>

0 commit comments

Comments
 (0)