Results 1 to 13 of 13

Thread: How do i close a buttonless dialog.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How do i close a buttonless dialog.

    I had to cheat to make it work the way I wanted.

    I added a check in the changeEvent:
    Qt Code:
    1. if (strPurged == "True")
    2. close();
    To copy to clipboard, switch view to plain text mode 

    At the end of the purgeCache function I assign True to strPurged.

    I noticed that even though I enter the closeEvent and the window wouldn't close, that a call was made to the changeEvent since closing is a changeEvent.

    Although this is a bit hackish it works. If there is a better way please let me know.

  2. #2
    Join Date
    Jan 2006
    Location
    Shanghai, China
    Posts
    52
    Thanks
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How do i close a buttonless dialog.

    After you override those virtual function, you should call the original version to make it do original things. e.g.
    Qt Code:
    1. void purge::closeEvent(QCloseEvent *e)
    2. {
    3. qDebug() << " in the close event";
    4. QDialog::closeEvent(e);
    5. }
    To copy to clipboard, switch view to plain text mode 
    1. Users don't have the manual, and if they did, they wouldn't read it.
    2. In fact, users can't read anything, and if they could, they wouldn't want to.

Similar Threads

  1. Delete/Close Dialog correct?
    By kei in forum Qt Programming
    Replies: 8
    Last Post: 2nd July 2009, 13:51
  2. Close Dialog in showEvent
    By pospiech in forum Qt Programming
    Replies: 3
    Last Post: 11th April 2008, 15:32
  3. Block close dialog
    By Mrdata in forum Newbie
    Replies: 2
    Last Post: 12th March 2007, 15:39
  4. Replies: 2
    Last Post: 5th February 2007, 17:42
  5. Replies: 3
    Last Post: 23rd July 2006, 18:02

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.