[Interest] When to save floating dock state?

Steve Atkins steve at blighty.com
Tue Jun 5 18:53:21 CEST 2018


I usually save QMainWindow state with saveState() in QMainWindow::closeEvent(), as pretty much all the examples suggest.

But if I have floating dock widgets and I exit the app then during the closeEvent the dock widget is usually (but not always) hidden, so saveState() records it as not visible, which means it's hidden when the app is restarted.

macOS Sierra, same behaviour on both Qt 5.9.0 and 5.11.0.

Is there a better point in the quit process to hook to save that state?

Cheers,
  Steve




More information about the Interest mailing list