• 6978阅读
  • 2回复

关于Qt中的emit [复制链接]

上一主题 下一主题
离线cipher1981
 
只看楼主 倒序阅读 楼主  发表于: 2009-09-30
— 本帖被 XChinux 执行加亮操作(2009-10-01) —
请问下Qt中的 emit 如何使用?

我的理解就是使用 emit + 信号函数 来发射一个信号
不知道是否正确?

是不是随时都可以 emit 一个信号函数 发射一个信号?
还是只能在槽函数中使用 emit ?

谢谢
离线dbzhang800

只看该作者 1楼 发表于: 2009-09-30
离线cipher1981
只看该作者 2楼 发表于: 2009-09-30
找到了:

Signals are emitted by an object when its internal state has changed in some way that might be interesting to the object's client or owner. Only the class that defines a signal and its subclasses can emit the signal.

When a signal is emitted, the slots connected to it are usually executed immediately, just like a normal function call.

谢谢~  呵呵
快速回复
限100 字节
 
上一个 下一个