Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Trouble with QAction



  • Hi,

    I made a class inherited from QAction and when I use my class I have a crash in my QApplication destructor.
    But I see that QAction destructor is not virtual. So it's bug or a conception will ?

    (sorry for my bad english)



  • I seen no Qt class have virtual destructor except QObject so they 're stored as QObject pointer ?

    QAction <- MdCommandAction
    QApplication<- MdCoreApplication

    MdCommandAction -- signal -> MdCoreApplication

    MdCommandAction is used in a QToolBar.
    My class (MdCommandAction) has a connection with MdCoreApplication made inside MdCommandAction contructor, for now it's the only specialization.
    the signal works well but I have crash segmentation fault during MdCoreApplication desctruction.
    A precision : I made a break point in MdCommandAction desctructor and it never stops on this break point.
    (that's why I ask for virtual destructor)

    (sorry for my bad english)


  • Lifetime Qt Champion

    Hi
    No sure what the issue is but could it be double deletion ?
    If you QAction is given a parent its will own and delete it so I wonder if
    you own clas maybe also delete it?


Log in to reply