summaryrefslogtreecommitdiffstats
path: root/examples/corelib/mimetypes/mimetypebrowser/mainwindow.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Deliver Quit event when calling QCoreApplication::quit()Tor Arne Vestbø2020-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of QCoreApplication::quit() directly calling exit(0), which would leave QGuiApplication and client code out of the loop, we now send the Quit event, and let it pass through event delivery, before finally ending up in QCoreApplication::event(), where we call exit(0). This has the advantage that QGuiApplication can ensure all windows are closed before quitting, and if any of those windows ignore the close event the quit will be aborted. This aligns the behavior of synthetic quits via QCoreApplication::quit() with spontaneous quits from the platform via QGuiApplicationPrivate::processApplicationTermination. Clients who wish to exit the application without any event delivery or potential user interaction can call the lower level exit() function directly. [ChangeLog][QtGui] Application termination via qApp->quit() will now deliver Quit events to the application, which in turn will result in application windows being closed as part of the application quit, with an option to cancel the application quit by ignoring the close event. Clients who explicitly want to exit the application without any user interaction should call QCoreApplication::exit() explicitly. Task-number: QTBUG-45262 Task-number: QTBUG-33235 Task-number: QTBUG-72013 Task-number: QTBUG-59782 Change-Id: Id4b3907e329b9ecfd936fe9a5f8a70cb66b76bb7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Examples: cleanup foreach usageChristian Ehrlicher2019-02-021-1/+3
| | | | | | | Replace deprecated foreach macro with range-based for loop Change-Id: If919ba1d1d4acddfc1c5460ce7aebf8c49e3ac38 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* MimeTypeBrowser: avoid memleaksChristian Ehrlicher2017-12-271-4/+3
| | | | | | | | | | | In MainWindow ctor some member values were allocated without a parent and not cleaned up in dtor. Fixed it by give them a valid parent so they get automatically cleaned up. Also m_treeView was initialized twice. Task-number: QTBUG-61862 Change-Id: I5590b87bb517c55db6eb58e700a5d419c0acdba2 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Martin Smith <martin.smith@qt.io>
* Replace outdated BSD license textKai Koehne2017-03-031-2/+12
| | | | | | | | For examples and documentation, use new BSD license text that includes the commercial licenses. Change-Id: I1cd74bd8e9c8f2746d8702df00780ee100cbebac Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Add mime type browser example.Friedemann Kleint2016-03-241-0/+185
Add an example showing the types in QMimeDatabase in a QTreeView with detailed information on click. The example has menu options to detect a file type and search by name. Change-Id: If6f1a6661edd100a54460a49562a8a8667245ddb Reviewed-by: David Faure <david.faure@kdab.com>