Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Trouble with QAction
Qt 6.11 is out! See what's new in the release blog

Trouble with QAction

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Roy44R Offline
    Roy44R Offline
    Roy44
    wrote on last edited by
    #1

    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)

    1 Reply Last reply
    0
    • Roy44R Offline
      Roy44R Offline
      Roy44
      wrote on last edited by
      #2

      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)

      1 Reply Last reply
      0
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        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?

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved