Skip to content

Latest commit

 

History

History
57 lines (47 loc) · 2.79 KB

note.c++.qt.event_system.md

File metadata and controls

57 lines (47 loc) · 2.79 KB
id title desc updated created
zr82dxk945c58occ6i52qi6
Event_system
1697815483547
1697506550946

refe

abstract concept

event occurs event deliver event source event type event handler

passive call, dependent the occurrence and delivered of event spontaneous event posted event sent event

understand

  • for cross platform
  • passive call
  • provide the specification(post: define->reigster->execute, send: define->execute) to bind event trigger and evnet handler
  • convenience of coding, provide a large num of event and default handler and process loop/thread previously, just to define the handler or event which you need actually and to combine them.
  • core idea of event system is to provide a way to mark various known event and control corresponding response behavior

handle flow and control the event propagated

key: 在 post 以及 send 时,已经获取到了执行 handler 的obj,以及 handler,event 。每一个 object 都存储了父对象指针,通过这种对象结构,形成树状依赖关系,来进行内存管理和数据的传递回溯

  1. who execute the handler and ergodic widget structure?
  2. the machanism of event propageted? when will the event be propageted? related fuhnction? call accept() to stop propagate further <==> reimplement and not calling default handler call ignore() to continue propagate further <==> call default handler passing up depends on default handler of qt 事件传递的过程实现就是一个 事件发送(send)或循环方(post->queue) 遍历和选择对象执行其event处理函数的过程

event dispatch with parent-child component

mouse press event spontaneous event how to pass target object??