ricardo
8th May 2009, 20:37
Hi mates!
When I receive a signal, I'd like to know in my SLOT if the sender is a QDockWidget, how can I test which kind of object is QObject::sender()?
There is a method called isA but I guess is obsolete because is not available on qt4.5
Any idea?
Thanks in advance.
EDIT:
BTW, Why doesn't work this:
QDockWidget* dock=(QDockWidget*) QObject::sender();
But this works perfectly:
QObject* sender = const_cast<QObject*>(QObject::sender());
QDockWidget* dock = static_cast<QDockWidget*>(sender);
When I receive a signal, I'd like to know in my SLOT if the sender is a QDockWidget, how can I test which kind of object is QObject::sender()?
There is a method called isA but I guess is obsolete because is not available on qt4.5
Any idea?
Thanks in advance.
EDIT:
BTW, Why doesn't work this:
QDockWidget* dock=(QDockWidget*) QObject::sender();
But this works perfectly:
QObject* sender = const_cast<QObject*>(QObject::sender());
QDockWidget* dock = static_cast<QDockWidget*>(sender);