From 04ca4ae67493e1724351ff19bd3028d985ff5fed Mon Sep 17 00:00:00 2001 From: Patrick Stewart Date: Wed, 13 May 2020 22:26:05 +0100 Subject: [PATCH] Support for Qt built with the -qtnamespace configure option (#170) --- examples/sidebar/MainWindow.h | 3 ++- examples/simple/MainWindow.h | 2 ++ src/DockAreaTitleBar.h | 2 +- src/DockAreaWidget.h | 4 ++-- src/DockContainerWidget.h | 2 +- src/DockManager.h | 4 ++-- src/DockOverlay.h | 2 +- src/DockWidget.h | 4 ++-- src/ads_globals.h | 4 ++-- 9 files changed, 15 insertions(+), 12 deletions(-) diff --git a/examples/sidebar/MainWindow.h b/examples/sidebar/MainWindow.h index bb6148f..5e2cd8c 100644 --- a/examples/sidebar/MainWindow.h +++ b/examples/sidebar/MainWindow.h @@ -4,10 +4,11 @@ #include #include "DockManager.h" +QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } - +QT_END_NAMESPACE /** * This example shows, how to place a dock widget container and a static diff --git a/examples/simple/MainWindow.h b/examples/simple/MainWindow.h index 462d4f6..8d90885 100644 --- a/examples/simple/MainWindow.h +++ b/examples/simple/MainWindow.h @@ -4,9 +4,11 @@ #include #include "DockManager.h" +QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } +QT_END_NAMESPACE class MainWindow : public QMainWindow { diff --git a/src/DockAreaTitleBar.h b/src/DockAreaTitleBar.h index 2a4505f..5b01528 100644 --- a/src/DockAreaTitleBar.h +++ b/src/DockAreaTitleBar.h @@ -34,7 +34,7 @@ #include "ads_globals.h" -class QAbstractButton; +QT_FORWARD_DECLARE_CLASS(QAbstractButton); namespace ads { diff --git a/src/DockAreaWidget.h b/src/DockAreaWidget.h index 50ccd01..d7b5360 100644 --- a/src/DockAreaWidget.h +++ b/src/DockAreaWidget.h @@ -35,8 +35,8 @@ #include "ads_globals.h" #include "DockWidget.h" -class QXmlStreamWriter; -class QAbstractButton; +QT_FORWARD_DECLARE_CLASS(QXmlStreamWriter); +QT_FORWARD_DECLARE_CLASS(QAbstractButton); namespace ads { diff --git a/src/DockContainerWidget.h b/src/DockContainerWidget.h index b23e017..50d3ae4 100644 --- a/src/DockContainerWidget.h +++ b/src/DockContainerWidget.h @@ -35,7 +35,7 @@ #include "ads_globals.h" #include "DockWidget.h" -class QXmlStreamWriter; +QT_FORWARD_DECLARE_CLASS(QXmlStreamWriter); namespace ads diff --git a/src/DockManager.h b/src/DockManager.h index e556046..dcef92a 100644 --- a/src/DockManager.h +++ b/src/DockManager.h @@ -36,8 +36,8 @@ #include "FloatingDockContainer.h" -class QSettings; -class QMenu; +QT_FORWARD_DECLARE_CLASS(QSettings); +QT_FORWARD_DECLARE_CLASS(QMenu); namespace ads { diff --git a/src/DockOverlay.h b/src/DockOverlay.h index 3cb87aa..ab9bb6e 100644 --- a/src/DockOverlay.h +++ b/src/DockOverlay.h @@ -26,7 +26,7 @@ #include #include #include -class QGridLayout; +QT_FORWARD_DECLARE_CLASS(QGridLayout); #include "ads_globals.h" diff --git a/src/DockWidget.h b/src/DockWidget.h index d66d769..5432f11 100644 --- a/src/DockWidget.h +++ b/src/DockWidget.h @@ -34,8 +34,8 @@ #include "ads_globals.h" -class QToolBar; -class QXmlStreamWriter; +QT_FORWARD_DECLARE_CLASS(QToolBar); +QT_FORWARD_DECLARE_CLASS(QXmlStreamWriter); namespace ads { diff --git a/src/ads_globals.h b/src/ads_globals.h index 201189c..d017842 100644 --- a/src/ads_globals.h +++ b/src/ads_globals.h @@ -37,7 +37,7 @@ #include #include -class QAbstractButton; +QT_FORWARD_DECLARE_CLASS(QAbstractButton); #ifndef ADS_STATIC #ifdef ADS_SHARED_EXPORT @@ -60,7 +60,7 @@ class QAbstractButton; // dumps to qDebug and std::cout after layout changes #define ADS_DEBUG_LEVEL 0 -class QSplitter; +QT_FORWARD_DECLARE_CLASS(QSplitter); namespace ads {