如何判断一个点(QPoint)是否在某个指定的qwidget里面

weixin_38066328 2019-09-19 03:27:24
Background / pre-condtion :For now, I had implemented a QTabWidget control. meanwhile, I also provide the context operation (mouse right click  menu),and it had run successfully. I append the action ("Remove") into the prior menu and implement the SLOT function for this action.Because QTabWidget has a default item is 0, When I trigger the Context event. How does the QTabWidget know that current index.At here, the only clue is the QPoint pt = QCursor::pos(); If I can verify which widget is I request via pt. The issue should be easy.Pls help me solve this. I will appreciate you!!BTW:  you just implement this method: int IsInWidget(QWidget* pwidget, QPoint pt);           return value means current index of QTabWidget control,            pWidget means specified Widget. pt means specified point coordinate.
...全文
158 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复

433

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧