码迷,mamicode.com
首页 > 其他好文 > 详细

Qt Gui中父控件监听子控件的IO事件

时间:2014-08-07 15:55:40      阅读:224      评论:0      收藏:0      [点我收藏+]

标签:style   color   os   io   ar   line   new   size   

父对象重新定义自己继承自QObject的函数bool eventFilter(QObject* watched, QEvent* event)。

子控件安装父对象的eventFilter:

例如,

QTableView * itsView = new QTableView;
itsView->viewport()->installEventFilter(this);

Qt Gui中父控件监听子控件的IO事件,布布扣,bubuko.com

Qt Gui中父控件监听子控件的IO事件

标签:style   color   os   io   ar   line   new   size   

原文地址:http://blog.csdn.net/tobacco5648/article/details/38417335

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!