Results 1 to 6 of 6

Thread: Crash application after delete window

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: Crash application after delete window

    Hmm, that is indeed not a lot to go on.

    Do you need to delete the window?

    I.e. it is not being deleted when the user closes it, so I am wondering why you need to delete it when you are closing it from code.

    Cheers,
    _

  2. #2
    Join Date
    Aug 2009
    Posts
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 1 Time in 1 Post

    Default Re: Crash application after delete window

    I`m find solution. I`m delete window not after close() are before show()

    Qt Code:
    1. if (window != 0) {
    2. delete window;
    3. window = 0;
    4. }
    5.  
    6. window = new QDeclarativeView();
    7. window->show();
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: Crash application after delete window

    you can call delete window even without the check for != 0 first,
    Delete is defined to do nothing on a null pointer.

    Cheers,
    _

Similar Threads

  1. Replies: 0
    Last Post: 15th October 2013, 09:32
  2. Crash in editorEvent with a delete key press event
    By xiangyu in forum Qt Programming
    Replies: 0
    Last Post: 26th March 2013, 15:57
  3. Replies: 3
    Last Post: 21st July 2010, 07:40
  4. delete runtime-created widgets causes crash
    By jonasbalmer in forum Qt Programming
    Replies: 5
    Last Post: 10th February 2010, 21:36
  5. crash when delete QTreeWidgetItem*
    By evgenM in forum Qt Programming
    Replies: 9
    Last Post: 9th December 2006, 20:04

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.