Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3949684
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:31:21+00:00 2026-05-20T01:31:21+00:00

I have a modeless dialog that overrides closeEvent() in order to save its state.

  • 0

I have a modeless dialog that overrides closeEvent() in order to save its state. This works fine if I actually close the dialog. However, if I just exit the application by whatever means (which of course results in my dialog closing), closeEvent() never gets called.

Is this by design? Is it a Qt bug? Is there something like a property I need to set on the widget to tell it to receive close events when the application is shutting down?

I guess I can duplicate the “save state” code in the dialog’s destructor, but it would be nicer if I didn’t have to.

Thanks for any thoughts!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T01:31:22+00:00Added an answer on May 20, 2026 at 1:31 am

    There’s a bug in Qt that when an application quits via menu command (instead of closing the last QMainWindow), the event system is not properly shutdown and objects on the heap are just leaked. It basically just calls exit(); right away.

    I filed a bug for this on the Mac platform. I don’t know what your platform is and if it’s also affected.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a modelless dialog that creates a thread, and if the cancel button
I like to write a modeless dialog based app, but I have a problem.
I have a very weird behaviour in a screen with a modeless dialog and
I have a modeless dialog box being generated which prompts users to open a
I have a modeless dialog, which is owned by the main window and snapped
I always have trouble remembering whether the modal or modeless dialog is the one
I have a WPF application that hosts a modeless Win32 form. Everything runs smoothly,
I have a modeless dialog which i need to show multiple instances of it
To preface we have a strange requirement that all dialogs must be modeless for
From what I understand to make dialog Modeless you have to allocate it on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.