Is there a way to declared a QT signal that can only be listened in within enclosing class?

丶灬走出姿态 提交于 2020-01-07 06:35:31

问题


QT signals are by default protected, which means they can be emitted in the object but can be listened anywhere.

But some signals are implementation details and I'm struggling to find a way to not let it go out of the class scope.

Is there a way to do it?

Update:

I want to use signals because I want to queue some lower priority tasks rather than handle them promptly at the point of emit/call. Is it a bad idea to use Qt::QueuedConnection for this purpose?

来源:https://stackoverflow.com/questions/29150610/is-there-a-way-to-declared-a-qt-signal-that-can-only-be-listened-in-within-enclo

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!