it's definitely neat, but it's nothing that you can't do with pure c++ though. It's just qt's native implementation of score guard pattern. Tbh I didn't even know it existed because I use my own scope guarder class.
On Fri, Feb 21, 2020 at 4:33 PM Henry Skoglund <he...@tungware.se> wrote: > Hi, just want to thank whoever worked to implement qScopeGuard (in > 5.12), it was a perfect gift from heaven today :-) > > I'm writing a LOB app with heavy database munging, and want to show the > user an hourglass cursor while munging/waiting for MS SQLServer. > However my functions have lots of exits due to bad weather etc. and I > dreaded pasting a restore-mouse-cursor call everywhere. Googled a bit > and now I use this 2-line magic at the top of my functions: > ... > qApp->setOverrideCursor(Qt::WaitCursor); > auto restoreCursor = qScopeGuard([] { > qApp->restoreOverrideCursor(); }); > ... > > Before I discovered Qt I spent 20 years in MFC purgatory, but now I've > seen the light! > > _______________________________________________ > Development mailing list > Development@qt-project.org > https://lists.qt-project.org/listinfo/development >
_______________________________________________ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development