Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.6.2, 5.9.1
-
None
-
Windows 7 32 bit, Visual Studio 2015
Description
Steps to reproduce:
- Create a QAction
- Connect the QObject:destroyed with a slot of your choice
- delete the action
- In the slot call qobject_cast<QAction*>(obj), it will return null always
This does not happen for QWidget, or any from QWidget derived classes.
PseudoCode:
void MyClass::Init() { ... QAction *pAction = new QAction(this); connect(pAction, &QObject::destroyed, this, &MyClass::OnActionDestroyed); delete pAction; ... } void MyClass::OnActionDestroyed(QObject* obj) { QAction* pAction = qobject_cast<QAction*>(obj); // pAction is always null although obj is correct }