Adds initial intermediate qt6 porting state
This commit is contained in:
11247 files changed
+1891537
No files matched your search
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* small stub to catch SIGTERM for proper shutdown
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include <signal.h>
|
||||
#include <QtCore/QCoreApplication>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <QtCore/QAbstractNativeEventFilter>
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
class MyEventFilter final : public QAbstractNativeEventFilter
|
||||
{
|
||||
public:
|
||||
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override
|
||||
{
|
||||
Q_UNUSED(eventType);
|
||||
Q_UNUSED(result);
|
||||
const MSG *msg = reinterpret_cast<const MSG*>(message);
|
||||
if (msg->message == WM_CLOSE && msg->hwnd == nullptr)
|
||||
QCoreApplication::quit();
|
||||
return false;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef SIGTERM
|
||||
# define SIGTERM 15
|
||||
#endif
|
||||
static void signalHandler(int signal_number)
|
||||
{
|
||||
if(signal_number != SIGTERM)
|
||||
return;
|
||||
QCoreApplication::quit();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user