From d08030ea8f04f056aed88a4ad96dc9233d069787 Mon Sep 17 00:00:00 2001 From: Sine Striker <trueful@163.com> Date: 周一, 01 1月 2024 19:18:10 +0800 Subject: [PATCH] Add license --- src/core/qwkglobal_p.h | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/core/qwkglobal_p.h b/src/core/qwkglobal_p.h index bc0d393..1691ef7 100644 --- a/src/core/qwkglobal_p.h +++ b/src/core/qwkglobal_p.h @@ -1,3 +1,6 @@ +// Copyright (C) 2023-2024 Stdware Collections +// SPDX-License-Identifier: Apache-2.0 + #ifndef QWKGLOBAL_P_H #define QWKGLOBAL_P_H @@ -10,6 +13,7 @@ // version without notice, or may even be removed. // +#include <QtCore/QObject> #include <QtCore/QLoggingCategory> #include <QtGui/QMouseEvent> @@ -42,6 +46,17 @@ namespace QWK { + namespace Private { + + class ObjectHelper : public QObject { + public: + static inline bool sendEvent(QObject *obj, QEvent *event) { + return static_cast<ObjectHelper *>(obj)->event(event); + } + }; + + } + inline QPoint getMouseEventScenePos(const QMouseEvent *event) { #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) return event->scenePosition().toPoint(); @@ -49,7 +64,7 @@ return event->windowPos().toPoint(); #endif } - + inline QPoint getMouseEventGlobalPos(const QMouseEvent *event) { #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) return event->globalPosition().toPoint(); @@ -57,7 +72,6 @@ return event->screenPos().toPoint(); #endif } - } #endif // QWKGLOBAL_P_H -- Gitblit v1.9.1