摘要: Qt的使用这个函数处理信号 void QMetaObject::activate(QObject *sender, int signalOffset, int local_signal_index, void **argv) 多线程情况下: 直连或者队列连接使用 queued_activate()处 阅读全文
posted @ 2024-05-13 19:37 愿得入睡 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 在声明信号的时候,Qt 会将信号于 QMetaThod 进行绑定,当emit 一个信号的时候, 会调用一个 QMetaMethod::invoke 函数。 查看源码, 在qmetaobject.h 中看到一个函数: bool QMetaMethod::invoke(QObject *object, 阅读全文
posted @ 2023-08-24 00:01 愿得入睡 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 声明: QThread* thread; 初始化: thread = new QThread(); thread->start();将对象放到线程中去: moveToThread(thread); readTimer.moveToThread(thread); readTimer.setSingle 阅读全文
posted @ 2023-08-21 23:13 愿得入睡 阅读(5) 评论(0) 推荐(0) 编辑
摘要: Qdebug 重定向 阅读全文
posted @ 2023-06-15 13:28 愿得入睡 阅读(75) 评论(0) 推荐(0) 编辑
摘要: Qt 使用ini 文件进行配置 阅读全文
posted @ 2023-05-31 23:57 愿得入睡 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Qt 中将std::cout 重定向到 qDebug 阅读全文
posted @ 2023-05-27 09:34 愿得入睡 阅读(312) 评论(0) 推荐(0) 编辑
摘要: #include <QCoreApplication>#include <QThread>#include <QDebug>#include <QMutex>#include <QWaitCondition>QMutex mutex;QWaitCondition readCondition;QWai 阅读全文
posted @ 2023-05-24 08:44 愿得入睡 阅读(12) 评论(0) 推荐(0) 编辑
摘要: ```cpp#include <QCoreApplication>#include <QThread>#include <QMutex>#include <QWaitCondition>#include <QDebug>QMutex mutex;QWaitCondition condition;bo 阅读全文
posted @ 2023-05-22 14:07 愿得入睡 阅读(20) 评论(0) 推荐(0) 编辑
摘要: static inline bool is_ident_char(char s) { return ((s >= 'a' && s <= 'z') || (s >= 'A' && s <= 'Z') || (s >= '0' && s <= '9') || s == '_' ); } static 阅读全文
posted @ 2023-05-21 07:37 愿得入睡 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 互斥 peterson -解法。 2个线程,C表示 阅读全文
posted @ 2023-05-19 09:29 愿得入睡 阅读(35) 评论(0) 推荐(0) 编辑