Skip to content

Commit

Permalink
fix: compiling faild in qt6.6
Browse files Browse the repository at this point in the history
  `#define private public` will change `any`'s access, so we
include it before qxcbwindow.h
  QT_HAS_INCLUDE has removed in qt6.6.
  • Loading branch information
18202781743 committed Nov 6, 2023
1 parent 355ee6b commit bb2c963
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ License: LGPL-2.1-only or GPL-3.0-only
# qt-oldfile-2
Files: xcb/libqt5xcbqpa-dev/5.1*.*/* xcb/libqt6xcbqpa-dev/6.*.*/*
Copyright: The Qt Company Ltd.
License: LGPL-3.0-only or GPL-2.0-only or GPL-3.0-or-later
License: LicenseRef-Qt-Commercial or LGPL-3.0-only or GPL-2.0-only or GPL-3.0-or-later
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(REQUIRED_QT_VERSION 5.15.0)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
Expand Down
8 changes: 8 additions & 0 deletions LICENSES/LicenseRef-Qt-Commercial.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Licensees holding valid commercial Qt licenses may use this software in
accordance with the the terms contained in a written agreement between
you and The Qt Company. Alternatively, the terms and conditions that were
accepted by the licensee when buying and/or downloading the
software do apply.

For the latest licensing terms and conditions, see https://www.qt.io/terms-conditions.
For further information use the contact form at https://www.qt.io/contact-us.
10 changes: 10 additions & 0 deletions src/dbackingstoreproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,17 @@
#include <private/qguiapplication_p.h>
#include <private/qhighdpiscaling_p.h>

#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
#if __has_include("utility.h")
#define __D_HAS_UTILITY__
#endif
#else
#if QT_HAS_INCLUDE("utility.h")
#define __D_HAS_UTILITY__
#endif
#endif

#ifdef __D_HAS_UTILITY__
#include "utility.h"
#include "dwmsupport.h"
#else
Expand Down
10 changes: 10 additions & 0 deletions src/dnativesettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@
#ifdef Q_OS_LINUX
#include "dxcbxsettings.h"
#endif
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
#if __has_include("dplatformintegration.h")
#define __D_HAS_DPLATFORMINTEGRATION__
#endif
#else
#if QT_HAS_INCLUDE("dplatformintegration.h")
#define __D_HAS_DPLATFORMINTEGRATION__
#endif
#endif

#ifdef __D_HAS_DPLATFORMINTEGRATION__
#include "dplatformintegration.h"
#define IN_DXCB_PLUGIN
#endif
Expand Down
10 changes: 10 additions & 0 deletions src/dxcbxsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@

#include "dxcbxsettings.h"

#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
#if __has_include("dplatformintegration.h")
#define __D_HAS_DPLATFORMINTEGRATION__
#endif
#else
#if QT_HAS_INCLUDE("dplatformintegration.h")
#define __D_HAS_DPLATFORMINTEGRATION__
#endif
#endif

#ifdef __D_HAS_DPLATFORMINTEGRATION__
#include "dplatformintegration.h"
#include "qxcbconnection.h"
#define IN_DXCB_PLUGIN
Expand Down
3 changes: 3 additions & 0 deletions xcb/dforeignplatformwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
#include <QtGlobal>

#ifdef Q_OS_LINUX
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
#include <any>
#endif
#define private public
#include "qxcbwindow.h"
typedef QXcbWindow QNativeWindow;
Expand Down
4 changes: 4 additions & 0 deletions xcb/dplatformintegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,11 @@ static xcb_cursor_t overrideCreateFontCursor(QXcbCursor *xcb_cursor, QCursor *c,
// special case for non-standard dnd-* cursors
cursor = loadCursor(dpy, cshape);

#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
if (!cursor && !xcb_cursor->m_callbackForPropertyRegistered) {
#else
if (!cursor && !xcb_cursor->m_gtkCursorThemeInitialized) {
#endif
VtableHook::callOriginalFun(xcb_cursor, &QPlatformCursor::changeCursor, c, window);

if (updateCursorTheme(dpy)) {
Expand Down
3 changes: 3 additions & 0 deletions xcb/dplatformwindowhelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#include <QtGlobal>

#ifdef Q_OS_LINUX
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
#include <any>
#endif
#define private public
#include "qxcbwindow.h"
#include "qxcbclipboard.h"
Expand Down

0 comments on commit bb2c963

Please sign in to comment.