As the title says, what is this thing and how do I handle it?
It's a QObject
and asks for a QObject
as it's parent. But at the same time it has child objects that are clearly QWidgets
.
Typically with QObject
s, you can either let the parent delete it when the parent is deleted, or you can delete it yourself. But QSystemTrayIcon
doesn't seem to work this way - I've tried making it the child of an arbitrary QObject and then letting it's parent delete it - when I do this, a lingering event gets sent to the QSystemTrayIcon that's been parent-deleted. On OSX this segfaults because it ends up sending an obj message to an invalid object.
This might be because the QMainWindow is going away at the same time in my application.
If I have to delete it explicitly after un-childing it, why? And if that's the case, it sounds like this is timing-dependent or something.
If QSystemTrayIcon
really just wants a QWidget
as its parent, why isn't its constructor written that way?