@ttuna
Hello,
Thanks, I know that. I wanted to have a method of my private object to be queued for later execution, because the ChildAdded event that I'm handling in an event filter is propagated before the child object is fully constructed. It appears that the gadgets have no such capability so I've implemented the functionality as a private slot, and it works okay. For anyone that might be interested, here's how:
class AGUI_API AgDial : public QStackedWidget
{
Q_OBJECT
// ...
private:
Q_PRIVATE_SLOT(d(), void scheduleChildAdd(QPointer<QObject>))
};
With the corresponding invocation in the event filter:
bool AgDial::eventFilter(QObject * object, QEvent * event)
{
switch (event->type())
{
case QEvent::ChildAdded:
QMetaObject::invokeMethod(this, "scheduleChildAdd", Qt::QueuedConnection, Q_ARG(QPointer<QObject>, QPointer<QObject>(reinterpret_cast<QChildEvent *>(event)->child())));
break;
// ...
}
}
Kind regards.