slot

signals and slots in multilayered UI widgets

孤人 提交于 2019-11-26 12:48:37
问题 Let\'s say we have the follogin UI: +--------------------------+ |W1 +--------------+ | | |W2 | | | | +----------+ | | | | |W3 | | | | | +----------+ | | | | | | | +--------------+ | +--------------------------+ W3 is interested in a certain signal emited in W1 (or a level below, i.e. qApp). The idea is to develop W3 independently. But somebody has to do the signal/slot connection. What would be a good practice/recommended way of connecting the signal emited in W1 into slot in W3 if we want

How delete and deleteLater works with regards to signals and slots in Qt?

♀尐吖头ヾ 提交于 2019-11-26 04:19:06
问题 There is an object of class QNetworkReply. There is a slot (in some other object) connected to its finished() signal. Signals are synchronous (the default ones). There is only one thread. At some moment of time I want to get rid of both of the objects. No more signals or anything from them. I want them gone. Well, I thought, I\'ll use delete obj1; delete obj2; But can I really? The specs for ~QObject say: Deleting a QObject while pending events are waiting to be delivered can cause a crash.