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 new widgets/windows

Creating new widgets/windows

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

    My application is having many subwindows/widgets and upon clicking a button the new screen/widget gets created.
    I am creating a new screen dynamically everytime, and I just wanted to know if thats the proper way and closing the screens would delete the object.
    Is there a way of managing the screen creation in a better way.

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      What is a "screen", a top-level widget?

      Widgets are deleted automatically when closed if the Qt::WA_DeleteOnClose attribute is set (or when their parent is deleted).

      If you just want to hide a widget and re-show it later on use QWidget::hide() and QWidget::show() instead.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        Kewal
        wrote on last edited by
        #3

        I was considering should we create and delete it everytime or just show and hide. Probably the answer would be 'Depends' based on the scenario. All my previous applications (Non - QT) were behaving in the creation and deletion way. I am bit confused if I need to use the show and hide,. what I need to be doing if the widgets are too big (in terms of memory)

        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