zlel
V2EX  ›  Qt

Qt 的信号与槽的疑问?

  •  
  •   zlel · Apr 12, 2017 · 11186 views
    This topic created in 3491 days ago, the information mentioned may be changed or developed.

    最近看到一些代码,在 singal 与 slot 建立连接之前,就开始 emit singal ,这样写也是没问题的吗?

    3 replies  •  2017-04-12 11:38:57 +08:00
    aogg
    aogg
    Apr 12, 2017
    1
    同在学 QT ,如果按照 js 的来就是没有接收方,就执行完毕,不报错,随便发
    zlel
    zlel
    OP
    Apr 12, 2017
    2
    @aogg 刚才测试了一下,不建立连接,只是发送信号,没有任何错误的。
    initialdp
    initialdp
    Apr 12, 2017
    3
    这种情况下,发出 signal 是没有任何意义的,没有 slot 来处理。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5599 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 03:01 · PVG 11:01 · LAX 19:01 · JFK 22:01
    ♥ Do have faith in what you're doing.