摘要: #include "QtWidgetsApplication1.h" #include <QtWidgets/QApplication> class GlobalEventFilter : public QObject { public: virtual bool eventFilter(QObje 阅读全文
posted @ 2024-09-26 12:13 MarsCactus 阅读(27) 评论(0) 推荐(0)
摘要: Helper variable template template< class... B > inline constexpr bool disjunction_v = disjunction<B...>::value; (since C++17) Possible implementation 阅读全文
posted @ 2024-09-20 12:04 MarsCactus 阅读(82) 评论(0) 推荐(0)
摘要: corelib\kernel\qobjectdefs.h template <typename T> inline QTemplatedMetaMethodReturnArgument<T> returnArgument(const char *name, T &t) { return { qMet 阅读全文
posted @ 2024-09-20 11:00 MarsCactus 阅读(574) 评论(0) 推荐(0)
摘要: Qt 创建连接类型如果是 Qt::BlockingQueuedConnection,即sender thread 与 receiver thread 不同, 但是要求 sender signal 与 receiver slot 执行是 不同线程间的同步行为。也即:在sender signal 发出后 阅读全文
posted @ 2024-09-18 18:10 MarsCactus 阅读(412) 评论(0) 推荐(0)
摘要: 先执行全局过滤器 上一步返回false 则 执行 receiver 上注册的事件过滤器 上一步返回false 这 执行 receiver 的 event 事件处理函数,根据具体事件类型执行 具体事件处理器函数 如:MousePressEvent(QEvent* e) 根据上一步receiver 的e 阅读全文
posted @ 2024-09-18 14:37 MarsCactus 阅读(73) 评论(0) 推荐(0)
摘要: 转自:Trivial, standard-layout, POD, and literal types https://learn.microsoft.com/en-us/cpp/cpp/trivial-standard-layout-and-pod-types?view=msvc-170 http 阅读全文
posted @ 2024-09-18 11:39 MarsCactus 阅读(48) 评论(0) 推荐(0)
摘要: QString methodType(QMetaMethod::MethodType mety) { switch (mety) { case QMetaMethod::Signal: return QString("QMetaMethod::Signal"); case QMetaMethod:: 阅读全文
posted @ 2024-09-18 01:51 MarsCactus 阅读(13) 评论(0) 推荐(0)
摘要: Qt中的Meta Type 包含两种类型,每个类型都以一个整型ID来表示, 内建类型和用户自定义类型(自定义类型对应的整型ID 从65536 即 QMetaType::User 开始): 1)内建类型: corelib\kernel\qmetatype.h // F is a tuple: (QMe 阅读全文
posted @ 2024-09-18 01:05 MarsCactus 阅读(115) 评论(0) 推荐(0)
摘要: 1.code class GranPa: public QObject { Q_OBJECT public: explicit GranPa(QObject *parent = nullptr); signals: void gran_siga(); void gran_sigb(); void g 阅读全文
posted @ 2024-09-17 13:16 MarsCactus 阅读(24) 评论(0) 推荐(0)