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. How to send signal class member to exit(quit) qApp->quit()
Forum Updated to NodeBB v4.3 + New Features

How to send signal class member to exit(quit) qApp->quit()

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 966 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.
  • N Offline
    N Offline
    newinqt
    wrote on last edited by
    #1

    PS. I' m new in QT!
    I have one class C1, and second class C2(is member pointer in class C1); When application exit, object class's C1 - quit very well (memory is free), but(!) object class's C2(is member pointer in class C1) not quit well. - he leave in memory. What I can do. that pointer C2 exit correct? I can't send signal. - i'ts not work( "error ,,,,,,,,,,(null) slot quit() )" Thank's!

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      You need to delete C2 object in the destructor of C1 class. If you don't know what a "destructor" is, search the web, it's pretty basic concept in C++ language.

      Alternatively, in Qt, you can also make both classes inherit from QObject, and assign C1 as a parent of C2: then Qt will automatically delete C2 for you when C1 is deleted.

      (Z(:^

      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