Skip to content

Commit 9c4ae16

Browse files
committed
refactor: Fix incomplete SFINAE issues with public slots
Using a class as a slot parameter requires it to be fully defined. Qt checks that to ensure correct behaviour. The checking is done via templates, where the SFINAE principle means that an incomplete class doesn't lead to errors. This can lead to issues when selecting the appropriate template, hence GCC warns about that. In the cases where issues can occur, this commit includes the full class definition. Thanks to @letsfindaway for the precise investigation.
1 parent 2a16f7b commit 9c4ae16

5 files changed

Lines changed: 19 additions & 12 deletions

File tree

src/board/UBBoardController.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,18 @@
3939

4040
#include "core/UB.h"
4141
#include "core/UBApplicationController.h"
42+
4243
#include "document/UBDocumentContainer.h"
4344

45+
#include "domain/UBGraphicsMediaItem.h"
46+
47+
#include "gui/UBBackgroundRuling.h"
48+
#include "gui/UBToolWidget.h"
49+
4450
class UBMainWindow;
4551
class UBApplication;
4652
class UBBoardView;
4753

48-
class UBBackgroundRuling;
4954
class UBBackgroundManager;
5055
class UBDocument;
5156
class UBDocumentController;
@@ -54,11 +59,9 @@ class UBGraphicsScene;
5459
class UBDocumentProxy;
5560
class UBEmbedController;
5661
class UBBlackoutWidget;
57-
class UBToolWidget;
5862
class UBVersion;
5963
class UBSoftwareUpdate;
6064
class UBSoftwareUpdateDialog;
61-
class UBGraphicsMediaItem;
6265
class UBGraphicsWidgetItem;
6366
class UBBoardPaletteManager;
6467
class UBItem;

src/domain/UBGraphicsScene.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,30 @@
2525
*/
2626

2727

28+
29+
2830
#ifndef UBGRAPHICSSCENE_H_
2931
#define UBGRAPHICSSCENE_H_
3032

3133
#include <QtGui>
3234
#include <optional>
3335

36+
#include "core/UB.h"
37+
3438
#include "frameworks/UBCoreGraphicsScene.h"
3539

36-
#include "core/UB.h"
40+
#include "gui/UBBackgroundRuling.h"
3741

42+
#include "UBGraphicsTextItem.h"
3843
#include "UBItem.h"
3944

40-
class UBBackgroundRuling;
4145
class UBGraphicsPixmapItem;
4246
class UBGraphicsSvgItem;
4347
class UBGraphicsPolygonItem;
4448
class UBGraphicsMediaItem;
4549
class UBGraphicsWidgetItem;
4650
class UBGraphicsW3CWidgetItem;
47-
class UBToolWidget;
4851
class UBGraphicsPDFItem;
49-
class UBGraphicsTextItem;
5052
class UBGraphicsRuler;
5153
class UBGraphicsProtractor;
5254
class UBGraphicsCompass;

src/podcast/UBPodcastController.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@
3636

3737
#include "core/UBApplicationController.h"
3838

39+
#include "web/simplebrowser/webview.h"
40+
3941
class UBGraphicsScene;
40-
class WebView;
4142
class UBPodcastRecordingPalette;
4243

4344
class UBDesktopPortal;

src/web/UBWebController.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@
3232

3333
#include <QtGui>
3434
#include <QRegularExpression>
35-
3635
#include <QWebEnginePage>
3736
#include <QWebEngineUrlRequestInterceptor>
3837

39-
#include "UBEmbedContent.h"
4038
#include "simplebrowser/downloadmanagerwidget.h"
39+
#include "simplebrowser/webview.h"
40+
41+
#include "UBEmbedContent.h"
4142

4243
class BrowserWindow;
43-
class WebView;
4444
class QMenu;
4545
class QWebEngineProfile;
4646
class QWebEngineView;

src/web/simplebrowser/browserwindow.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,15 @@
5656
#include <QTime>
5757
#include <QWebEnginePage>
5858

59+
#include "webview.h"
60+
5961
QT_BEGIN_NAMESPACE
6062
class QLineEdit;
6163
class QProgressBar;
6264
class QStatusBar;
6365
QT_END_NAMESPACE
6466

6567
class TabWidget;
66-
class WebView;
6768
class WBHistoryManager;
6869

6970
class BrowserWindow : public QWidget

0 commit comments

Comments
 (0)