QtCanpool 3.3.0
载入中...
搜索中...
未找到
windowkit_p.h
浏览该文件的文档.
1
5#ifndef WINDOWKIT_P_H
6#define WINDOWKIT_P_H
7
8//
9// W A R N I N G !!!
10// -----------------
11//
12// This file is not part of the QxWindow API. It is used purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or may even be removed.
15//
16
17#include "qxwindow_global.h"
18#include <QtCore/QLoggingCategory>
19#include <QtCore/QObject>
20#include <QtGui/QMouseEvent>
21
22Q_DECLARE_LOGGING_CATEGORY(qWindowKitLog)
23
24#define QWK_INFO qCInfo(qWindowKitLog) << "INFO:"
25#define QWK_DEBUG qCDebug(qWindowKitLog) << "DEBUG:"
26#define QWK_WARNING qCWarning(qWindowKitLog) << "WARNING:"
27#define QWK_CRITICAL qCCritical(qWindowKitLog) << "CRITICAL:"
28#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
29#define QWK_FATAL qCFatal(qWindowKitLog) << "FATAL:"
30#endif
31
32#define MAKE_RGB_COLOR(r, g, b) ((quint32)(((r) & 0xFF) << 16) | (((g) & 0xFF) << 8) | ((b) & 0xFF))
33
34#define MAKE_RGBA_COLOR(r, g, b, a) \
35 ((quint32)(((a) & 0xFF) << 24) | (((r) & 0xFF) << 16) | (((g) & 0xFF) << 8) | ((b) & 0xFF))
36
37#if defined(Q_CC_MSVC)
38#define QWK_NOINLINE __declspec(noinline)
39#define QWK_INLINE __forceinline
40#define QWK_USED
41#else
42#define QWK_NOINLINE __attribute__((noinline))
43#define QWK_INLINE __attribute__((always_inline))
44#define QWK_USED __attribute__((used))
45#endif
46
48
49#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
51#else
53#endif
54
55namespace Private
56{
57
58class ObjectHelper : public QObject
59{
60public:
61 static inline bool sendEvent(QObject *obj, QEvent *event)
62 {
63 return static_cast<ObjectHelper *>(obj)->event(event);
64 }
65};
66
67} // namespace Private
68
69inline QPoint getMouseEventScenePos(const QMouseEvent *event)
70{
71#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
72 return event->scenePosition().toPoint();
73#else
74 return event->windowPos().toPoint();
75#endif
76}
77
78inline QPoint getMouseEventGlobalPos(const QMouseEvent *event)
79{
80#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
81 return event->globalPosition().toPoint();
82#else
83 return event->screenPos().toPoint();
84#endif
85}
86
88
89#endif // WINDOWKIT_P_H
static bool sendEvent(QObject *obj, QEvent *event)
Definition windowkit_p.h:61
QPoint getMouseEventGlobalPos(const QMouseEvent *event)
Definition windowkit_p.h:78
QPoint getMouseEventScenePos(const QMouseEvent *event)
Definition windowkit_p.h:69
qintptr QT_NATIVE_EVENT_RESULT_TYPE
Definition windowkit_p.h:50
#define QX_WINDOW_END_NAMESPACE
#define QX_WINDOW_BEGIN_NAMESPACE