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. [Solved] QMdiSubWindow deletes internal widget on close?
Forum Updated to NodeBB v4.3 + New Features

[Solved] QMdiSubWindow deletes internal widget on close?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 3.3k 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.
  • S Offline
    S Offline
    Seba84
    wrote on last edited by
    #1

    Hello everyone,

    I have some questions:

    Does QMdiSubWindow deletes the internal widget on close?

    Does it delete the widget when ~QMdiSubWindow() is called?

    Does the widget get destroyed before program exit, or can I expect memory leakage?

    On documentation internal widget destruction time isn't very clear, and neither when ~QMdiSubWindow() is called.

    Thanks in advance!
    Cheers,
    Seba84

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Chris H
      wrote on last edited by
      #2

      On close, it hides itself, unless you tell it to delete on close via the Qt::WA_DeleteOnClose attribute, same as any other window.

      Again like any other widget, it will cause its children to be deleted when it is deleted.

      It does (usually), but even if it didn't, the OS will reclaim the memory, so it's not like you will have a memory leak once the program is shut down.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Seba84
        wrote on last edited by
        #3

        Thanks Chris!

        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