Results 1 to 4 of 4

Thread: Delete dialog

  1. #1
    Join Date
    Jul 2007
    Posts
    57
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Delete dialog

    I hav an application in which i show a Dialog when a key_1 is pressed.Once i enter the mainwindow i do want to delete the dialog objects.Suggest a way in which i can do the
    delete of the Dialog.I hav posted sample code

    this is in the constructor of mainClass
    connect(buttonBar->getButton(),SIGNAL,this,SLOT(showDialog())

    showDialog of mainClass look like this
    showDialog()
    {
    buttonBar->showDialog(this);
    }

    The buttonBar class showDialog looks like this
    showDialog(mainClass mc)
    {
    myDilalog=new myDialog((QWidget *)mc,mc);
    myDialog->show();
    }
    in the mainClass eventfilter i am giving the statement:

    buttonBar->showDialog(this); for keypress


    where can i delete the dialog.If i tried to delete in eventfilter its showing segmentation fault

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Delete dialog

    Well, you could try deleting it when the main window is shown the first time ( by overriding showEvent).

    Regards

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Delete dialog

    Maybe it will be simplier if you set the Qt::WA_DeleteOnClose attribute for that dialog?

  4. #4
    Join Date
    Jul 2007
    Posts
    57
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Delete dialog

    I tried using Qt::WA_DeleteOnClose...there is no change in my memory leak..

Similar Threads

  1. QGraphicsView: Dialog Position Doubt
    By arjunasd in forum Qt Programming
    Replies: 1
    Last Post: 6th August 2007, 18:48
  2. c++, placement delete upon exception
    By stinos in forum General Programming
    Replies: 6
    Last Post: 31st October 2006, 16:38
  3. Replies: 3
    Last Post: 23rd July 2006, 19:02
  4. Show/hide part of dialog with resizing.
    By Spockmeat in forum Qt Tools
    Replies: 6
    Last Post: 7th June 2006, 09:22
  5. Dialog positioning in GNOME
    By simk in forum Qt Programming
    Replies: 2
    Last Post: 16th March 2006, 10:41

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.