Results 1 to 2 of 2

Thread: delete QWidget

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2009
    Location
    Shenzhen,China
    Posts
    21
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default delete QWidget

    As we know a widget is will be delete when the parent is delete, but if i just want to delete itself without release the parent, how to do this?
    Is it conflict with the rules of Qt?

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: delete QWidget

    Simply delete the widget. It doesnt conflict. Its C++.
    Qt only simplifies you garbage management by deleting the childs if the parent is deleted. It doesnt restrict you to delete the child explicitly and doesnt result in error if you do so.

Similar Threads

  1. Promoting the parent QWidget of a QWidget form
    By extrakun in forum Qt Tools
    Replies: 6
    Last Post: 16th April 2010, 15:19
  2. "new" + "delete" a QWidget and its children
    By vkincaid in forum Qt Programming
    Replies: 2
    Last Post: 19th January 2010, 22:51
  3. Replies: 4
    Last Post: 19th February 2009, 12:10
  4. QWidget delete at once
    By bunjee in forum Qt Programming
    Replies: 3
    Last Post: 14th February 2008, 14:46
  5. Replies: 1
    Last Post: 2nd May 2006, 22:11

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.