summaryrefslogtreecommitdiffstats
path: root/examples/widgets/mainwindows/application/mainwindow.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove "fallback session management"Andreas Hartmetz2020-09-011-1/+0
| | | | | | | | | | | | | | With the Qt6 compatibility break, it can finally be removed. Closing windows (which might quit the application with quitOnLastWindowClosed() true, the default) acted contrary to the documentation of the commitDataRequest() signal, which could have been a hint. This removes the workaround API from the fix for QTBUG-49667 and also removes the problematic feature that it worked around. Change-Id: I672be58864ef062df7fb7f2a81658b92c4feedd2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Prepare for deprecating the QDesktopWidgetSona Kurazyan2019-10-151-1/+1
| | | | | | | | | | | | | | QDesktopWidget is marked as obsolete in docs, but it is not yet completely deprecated, some of its methods are still in use. Replace uses of the following methods marked as obsolete: - QDesktopWidget::screenNumber(QWidget*) -> QWidget::screen() - QDesktopWidget::screenGeometry(QWidget*) -> QWidget::screen()->geometry() - QDesktopWidget::availableGeometry(QWidget*) -> QWidget::screen()->availableGeometry() Task-number: QTBUG-76491 Change-Id: I2cca30f2b4caa6e6848e8190e09f959d2c272f33 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use QSaveFile in MainWindow examplesFriedemann Kleint2019-06-121-14/+18
| | | | | | | | | | | | | | | | | QSaveFile should preferably be used by editor applications to catch write errors. Task-number: QTBUG-60635 Change-Id: Ia609435871b56b45714c3dd3d32bbc85b5cb4dd5 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix usage of QGuiApplication::set/resetOverrideCursorChristian Ehrlicher2018-11-051-4/+4
| | | | | | | | | Replace all occurrences of QApplication::set/resetOverrideCursor with the QGuiApplication::set/resetOverrideCursor since it's a static function of QGuiApplication. Change-Id: Ic898ab50a7ad4ed2bc9c6acb26cf4a979c2f82af Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-131-1/+4
|\ | | | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/compile.test src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java src/testlib/qtestcase.cpp src/testlib/qtestcase.qdoc Change-Id: Ied3c471dbc9a076c8de33d673bd557e88575609d
| * Fix compiling examples with -no-smJoni Poikelin2016-04-071-1/+4
| | | | | | | | | | | | | | | | There is access to session manager functions which are not present when building with -no-sm. Change-Id: I1c92b4a70f7adb56816877930fb9f55b04ff8940 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* | Unify license header usage.Jani Heikkinen2016-03-291-3/+13
|/ | | | | | | | | Update files using old header.LGPL3 to header.LGPL Update files using old FDL template to use new one Update files using old BSD template to use new one Change-Id: I36a78272516f9953d02956522f285b40adfc8915 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Add option to disable "session management by closing windows".Andreas Hartmetz2016-02-151-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | That feature is a poor man's session management for applications that do not implement any specific session management features. It badly interferes with proper session management support, so applications must be able to disable it. This enables fixing applications with QGuiApplication::quitOnLastWindowClosed() true - the default - dying too early, before they are enumerated for the list of applications to restart on session restore, thus preventing them from being restored. See https://bugs.kde.org/show_bug.cgi?id=354724 [ChangeLog][QtGui] Qt asking to close windows on session exit as a fallback session management mechanism has been made optional. Disabling it fixes session management for applications that implement full session management. See QGuiApplication::isFallbackSessionManagementEnabled(). Task-number: QTBUG-49667 Change-Id: Ib22e58c9c64351dea8b7e2a74db91d26dd7ab7aa Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: David Faure <david.faure@kdab.com>
* Fix mainwindow examples when clipboard support is disabled.Rafael Roquetto2015-08-111-0/+5
| | | | | | | Some platforms, such as QNX, do not implement QT_CLIPBOARD. Change-Id: I3a8b484b4c00c28a91d3727054672c3788f98381 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Polish the widgets/mainwindows/application example.Friedemann Kleint2015-07-131-104/+87
| | | | | | | | | | | | | | | | | | | | | | | | | - Introduce Qt 5 signals & slot syntax - Use QCommandLineParser to obtain file arguments - Merge MainWindow::createMenus()/createQToolBars() into MainWindow::createActions(), removing the need to store the actions as member variables. Use QMenu::addAction() for brevity. - Use QIcon::fromTheme() to obtain system icons and use resource icons as fallback. - Rewrite settings code to use QWidget::saveGeometry(), Widget::restoreGeometry() since saving size and position does not work well with multiple screens. Query the available size when determining the initial size instead of using hard-coded values for High-DPI screens. - Fix minor issues in code, use multi-argument version of QString::arg(), QDir::toNativeSeparators() to present file paths to the user. - Fix snippet references accordingly. Change-Id: I1bc49a8913aa6d669e0e666f04be3f1f42eaba10 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Updated BSD licensed file headersJani Heikkinen2015-02-151-3/+3
| | | | | Change-Id: I6441ff931dbd33b698d762e6f6784898f3f60fe7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-5/+5
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Fix cancel operation for example "Application"Mika Salmela2014-09-171-4/+4
| | | | | | | | | On the save dialog the cancel option is detected now from exec() method. Change-Id: I977626b83fe770ddc148b57551becd04e5fd9dd5 Task-number: QTBUG-41020 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* Save using a window-modal sheet on Mac OS X.Morten Johan Sørvig2014-03-201-3/+8
| | | | | | Change-Id: Icd150787f9ff0878fafd459b3741d1b1e008f8bc Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Use organization name "QtProject" in examples.Friedemann Kleint2012-10-161-2/+2
| | | | | Change-Id: Ibbe9517ccf81d25eccbdff98f7cfe8ff6ec485d2 Reviewed-by: hjk <qthjk@ovi.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-6/+6
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Moving .qdoc files under examples/widgets/docGabriel de Dietrich2012-08-201-0/+392
Updated those .qdoc files to refer to the new relative examples emplacement. Images and snippets to be moved later. Also grouped all widgets related examples under widgets. Change-Id: Ib29696e2d8948524537f53e8dda88f9ee26a597f Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>