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)


  • Qt Champions 2016

    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
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.