如何将此功能添加到 Qt 4.6 嵌入式 Linux QWS(Qt 窗口系统)?
当任何正在运行的应用程序的任何小部件获取 Paint 事件时,我想从 Qt Server 向名为“Video Player”的 Qt 应用程序发送一个事件。
怎么做呢?
I want to send an event to an Qt Application named "Video Player" from Qt Server when any of the running application 's any widget gets Paint Event.
How to do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您可以访问其他应用程序并且您的设备上有可用的 DBus,我建议您将其用于此目的。您可以在通过 DBus 发出信号的每个其他应用程序中安装一个事件处理程序,并且您的视频播放器应用程序可以订阅该信号并在收到信号时执行所需的任何操作。
不过,我怀疑您是否能够从 QWS 获取绘制事件。它可能只是告诉给定的应用程序哪个区域/矩形需要刷新,并且应用程序找到适当的小部件并向它们发送绘制事件。如果 QWS 了解给定应用程序中的各个小部件,我会感到惊讶。
If you have access to the other applications and have DBus available on your device, I would suggest using it for this purpose. You can install an event handler in each of the other applications that emits a signal over DBus, and your video player application can subscribe to that signal and do whatever it needs to when it gets the signal.
I doubt that you'll be able to get paint events from the QWS, however. It probably just tells the given application what region/rectangle needs refreshed, and the application finds the appropriate widgets and sends them the paint events. I would be surprised if the QWS had any knowledge of the individual widgets in a given application.