Results 1 to 4 of 4

Thread: Open new window when button on main-window is clicked

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Open new window when button on main-window is clicked

    This is just standard C++ memory management. It depends on where and how you use it. For windows that are to be short lived (e.g. modal QDialogs) then you can create them on the stack and they are automatically cleaned up as they go out of scope. If you allocate the memory on the heap with new then you must ensure that delete is called at some point. Usually the destructor of the allocating class is the correct place. Another option is to use one of the "smart" pointers: QScopedPointer or QSharedPointer.

  2. The following user says thank you to ChrisW67 for this useful post:

    SNK111 (23rd December 2010)

Similar Threads

  1. Replies: 0
    Last Post: 10th September 2010, 13:23
  2. Replies: 2
    Last Post: 4th August 2010, 19:10
  3. Replies: 9
    Last Post: 16th May 2010, 16:21
  4. Replies: 10
    Last Post: 6th July 2008, 09:46
  5. Maximize Window button of Manin Window
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 1st August 2007, 08:20

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.