/*!
Returns a pointer to the object that sent the signal, if called in
a slot activated by a signal; otherwise it returns 0. The pointer
is valid only during the execution of the slot that calls this
function from this object's thread context. The pointer returned by this function becomes invalid if the
sender is destroyed, or if the slot is disconnected from the
sender's signal. \warning This function violates the object-oriented principle of
modularity. However, getting access to the sender might be useful
when many signals are connected to a single slot. \warning As mentioned above, the return value of this function is
not valid when the slot is called via a Qt::DirectConnection from
a thread different from this object's thread. Do not use this
function in this type of scenario. \sa senderSignalIndex(), QSignalMapper
*/ QObject *QObject::sender() const
{
Q_D(const QObject); QMutexLocker locker(signalSlotLock(this));
if (!d->currentSender)
return 0; for (QObjectPrivate::Connection *c = d->senders; c; c = c->next) {
if (c->sender == d->currentSender->sender)
return d->currentSender->sender;
} return 0;
}

使用 lambda 表达式做槽函数时,相当于使用了 Qt::DirectConnection 方式连接槽,都在同一个线程中,故获取发送信号对象指针时,直接给你返回了 0.

最新文章

  1. 如何dos中查看当前MySQL版本信息?
  2. HDU 1907 Nim博弈变形
  3. Introduction to Microsoft Dynamics 365 licensing
  4. Docker run命令详解 转
  5. 获取指定的系统路径 SHGetSpecialFolderPath
  6. Chrome远程调试Android上Chrome的页面
  7. c语言学习之基础知识点介绍(三):scanf函数
  8. CoreAnimation2-视觉效果和变换
  9. Frequent values
  10. Asp.Net长文件名下载的问题和解决办法
  11. linux chmod使用说明
  12. [置顶] 简单解析linux下进程通信方法
  13. java 异常处理机制及说明。
  14. JavaScriptSerializer返回一条Json,页面获取值问题,数据绑定
  15. 使用Session防止表单重复提交
  16. Chapter 15_3 使用环境
  17. 安卓图表引擎AChartEngine(五) - Dataset和Render参数介绍
  18. OpenStack实践系列④计算服务Nova
  19. 复习reactnative....
  20. linux--切换ipython解释器到python3

热门文章

  1. offsetof宏的实现
  2. 自己定义滑动删除item的ListView。
  3. html 基本标签 ---字体
  4. jsp中跳出循环
  5. vim搜索设置高亮
  6. mybatis传多个参数实例
  7. hdu1695 GCD 莫比乌斯反演做法+枚举除法的取值 (5,7),(7,5)看做同一对
  8. python文章的抓取
  9. net 代码生成
  10. 日期类Date