Modernize Windows Qt6 wallet build

This commit is contained in:
root
2026-04-30 14:46:44 +00:00
parent 099316b662
commit c90370640c
17 changed files with 137 additions and 95 deletions
+19 -18
View File
@@ -4,6 +4,25 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifdef WIN32
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0501
#ifdef _WIN32_IE
#undef _WIN32_IE
#endif
#define _WIN32_IE 0x0501
#define WIN32_LEAN_AND_MEAN 1
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#include <shellapi.h>
#include <shlobj.h>
#include <shlwapi.h>
#endif
#include "guiutil.h"
#include "bitcoinaddressvalidator.h"
@@ -19,24 +38,6 @@
#include "script/standard.h"
#include "util.h"
#ifdef WIN32
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0501
#ifdef _WIN32_IE
#undef _WIN32_IE
#endif
#define _WIN32_IE 0x0501
#define WIN32_LEAN_AND_MEAN 1
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include "shellapi.h"
#include "shlobj.h"
#include "shlwapi.h"
#endif
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#if BOOST_FILESYSTEM_VERSION >= 3
+1 -1
View File
@@ -17,7 +17,7 @@
// If we don't want a message to be processed by Qt, return true and set result to
// the value that the window procedure should return. Otherwise return false.
bool WinShutdownMonitor::nativeEventFilter(const QByteArray& eventType, void* pMessage, long* pnResult)
bool WinShutdownMonitor::nativeEventFilter(const QByteArray& eventType, void* pMessage, WinShutdownMonitorResult* pnResult)
{
Q_UNUSED(eventType);
+8 -1
View File
@@ -12,12 +12,19 @@
#include <windef.h> // for HWND
#include <QAbstractNativeEventFilter>
#include <QtGlobal>
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
typedef qintptr WinShutdownMonitorResult;
#else
typedef long WinShutdownMonitorResult;
#endif
class WinShutdownMonitor : public QAbstractNativeEventFilter
{
public:
/** Implements QAbstractNativeEventFilter interface for processing Windows messages */
bool nativeEventFilter(const QByteArray& eventType, void* pMessage, long* pnResult);
bool nativeEventFilter(const QByteArray& eventType, void* pMessage, WinShutdownMonitorResult* pnResult);
/** Register the reason for blocking shutdown on Windows to allow clean client exit */
static void registerShutdownBlockReason(const QString& strReason, const HWND& mainWinId);