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. Creating and destroying non-modal dialogs
Forum Updated to NodeBB v4.3 + New Features

Creating and destroying non-modal dialogs

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 149 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.
  • A Offline
    A Offline
    Andrej-ABC-Solovjev
    wrote on last edited by
    #1

    The simplest description of my question is following. Suppose on the main window there is a single button. Each pressing of the button leads to the creation of another non-modal dialog (QDialog). The user opens and closes dialogs in random order. Since I create dialogs using the new operator and not control the moment of the dialog window closing, I worry about the memory leakage. Any comments please!

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

      Hi
      There is a flag for that use case
      diag->setAttribute(Qt::WA_DeleteOnClose);

      It will make it delete it self when close() is called.

      1 Reply Last reply
      2

      • Login

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