From beea9a32ceb459e5e419c2a87bbe46e6cbfc4764 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Wed, 12 Aug 2026 19:03:48 +0000 Subject: [PATCH] Qt4: add explicit includes that were only reaching us transitively under Qt6 - logger.h: Q_DECLARE_METATYPE(Logger::Message) needs , which Qt6 headers happened to pull in transitively but Qt4's don't -- this was the actual moc build failure reported. - common.h: OFF_ICON/ON_ICON/etc. construct QPixmap directly in these macros; add so it's guaranteed wherever they're expanded, rather than relying on whatever the including .cpp happens to pull in. - mainwindow.cpp: constructs QIcon objects directly (tray icon selection), not just via ui_mainwindow.h's auto-generated widget members. - vpninfo.cpp: uses QFile/QTextStream (logVpncScriptOutput) with neither included, direct or transitive. Audited the rest of the tree for the same pattern (a class used in a .cpp with no matching direct or obviously-transitive include); these were the ones not plausibly covered by an existing include already (e.g. classes only ever reached via ui_*.h-generated members, or types whose owning base-class header necessarily defines them, were left alone). Since this can't be verified by compiling, more of the same class of error may still surface Qt4-side. --- src/common.h | 2 ++ src/dialog/mainwindow.cpp | 1 + src/logger.h | 1 + src/vpninfo.cpp | 2 ++ 4 files changed, 6 insertions(+) diff --git a/src/common.h b/src/common.h index 7d70f0d..38f0cf1 100644 --- a/src/common.h +++ b/src/common.h @@ -19,6 +19,8 @@ #pragma once +#include + /* undef on normal builds */ #undef PROJ_GNUTLS_DEBUG diff --git a/src/dialog/mainwindow.cpp b/src/dialog/mainwindow.cpp index 7c17e41..c826a6a 100644 --- a/src/dialog/mainwindow.cpp +++ b/src/dialog/mainwindow.cpp @@ -41,6 +41,7 @@ extern "C" { #include #include #include +#include #include #include #include diff --git a/src/logger.h b/src/logger.h index bcc1c27..e307c29 100644 --- a/src/logger.h +++ b/src/logger.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include diff --git a/src/vpninfo.cpp b/src/vpninfo.cpp index 75bfea9..a02c9f7 100644 --- a/src/vpninfo.cpp +++ b/src/vpninfo.cpp @@ -28,7 +28,9 @@ #include "server_storage.h" #include +#include #include +#include #include #include -- 2.43.0