Results 1 to 2 of 2

Thread: Cancelling an Object Creation

  1. #1
    Join Date
    Jan 2010
    Posts
    19
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Cancelling an Object Creation

    Hi,

    My program generates a 3d model in a qvtkWidget when the 'Generate' button in one of the dialogs of the main window is clicked. During the creation of the model, a QProgressDialog appears. When the 'Cancel' button in the QProgressDialog is clicked, the model and the object pertaining to it are deleted, as desired, however the program crashes. I think that the problem is that after the model is deleted, the program returns to where it was in the code the instant that the 'Cancel' button was clicked, calling methods whose classes were just deleted. How can I get the program to reset to the where it was before the 'Generate' button was clicked?

    I hope this makes sense

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Cancelling an Object Creation

    How do you stop the creation and how do you delete the "created" widgets? Maybe deleteLater() fits your needs. Also make sure you don't access a pointer to the widget you just have deleted. But therefore we have to see more code on how you stop the creation etc.

Similar Threads

  1. Cancelling Long-running Print/Print Preview
    By ChrisW67 in forum Newbie
    Replies: 4
    Last Post: 16th June 2009, 23:05
  2. writing object to the file(Object Persistance)
    By jjbabu in forum Qt Programming
    Replies: 2
    Last Post: 11th June 2009, 14:28
  3. Replies: 1
    Last Post: 2nd March 2009, 19:32
  4. Multiple form object creation
    By kpmsivachand in forum Qt Programming
    Replies: 2
    Last Post: 3rd February 2009, 01:09
  5. Cancelling a pending database insert
    By innerhippy in forum Qt Programming
    Replies: 3
    Last Post: 30th October 2008, 08:53

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.