QTimer::singleShot and QMetaMethod::invoke

后端 未结 3 1658
醉梦人生
醉梦人生 2021-01-01 19:26

In some Qt examples, I see they use QTimer::singleShot(0, this , SLOT(funcA())), why not to call the slot funcA directly? also the same question f

3条回答
  •  时光取名叫无心
    2021-01-01 19:32

    These methods can also be used to invoke protected and private members of a class (if they are defined as slots) from a scope that would otherwise require public access.

提交回复
热议问题