summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs/qdialog.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Doc: complete the snippet for a dialog with extensionVolker Hilsheimer2024-01-111-0/+4
| | | | | | | | | | | | | | Add the setting of the layout's size constraint to 'fixed' back to the snippet, so that the dialog automatically resizes when the extension gets hidden. The user won't be able to resize the dialog, but allowing the user to resize the dialog and to show and hide the extension anyway leads to unpredictable results for the user. Amends 11da92ba94570e5eec01597fe09f0a9a48acc677. Pick-to: 6.7 6.6 Change-Id: Ie74ca36eaa1a8e9567e0d5826f91f8633e5cbc05 Reviewed-by: David Faure <david.faure@kdab.com>
* Unify QDialog WA_WState_ExplicitShowHide handlingTor Arne Vestbø2023-10-231-5/+4
| | | | | | | | | | | | | | | | Instead of checking it inside QDialogPrivate::setVisible and its overrides, we can check it in QDialog::setVisible, up front. The logic in QDialogPrivate::setVisible related to modality that was executed prior to the WA_WState_ExplicitShowHide is now skipped in the case the WA_WState_ExplicitShowHide condition hits, but this makes sense as the modality logic has a second part at the end of the function, restoring the modality, and this part was never executed as the code was prior to this change. Change-Id: I9580e91dbc5a981c83538d765b86138afee44f14 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QMessageBox: Respect clients overriding QDialog::done()Tor Arne Vestbø2023-06-291-22/+14
| | | | | | | | | | | | | | As a result of d8bbb5ee0e60d44a70d29306e607a59caf7fe5bc, we were no longer calling QDialog::done(), which users may have overridden. We now pull out the dialog code to determine whether to emit accepted/rejected directly in done(), so that we can go back to calling QDialog::done(). Pick-to: 6.6 6.5 Change-Id: Ie08270123d61d9010acd8c989b66986f71960ad0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QDialog - avoid potential crashThorbjørn Lund Martsum2023-05-241-1/+3
| | | | | | | | | | | | In case the dialog is deleted while signals are emitted, we should likely prevent a crash. Now, obviously it would be remarkable if people deleted the dialog meanwhile, but it can also happen if the attribute WA_DeleteOnClose is set and QAppliction::processEvents() is called in a slot connected to accepted or rejected. Pick-to: 6.5 Change-Id: Iafa708dec2c1064ea890f222ff5a8d15c94cbe4c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Convert "extension" dialog example into snippetsVolker Hilsheimer2023-05-161-5/+9
| | | | | | | Pick-to: 6.5 Task-number: QTBUG-108751 Change-Id: I8ca4e058b832674dc0c8b84024cb70a667ee8db4 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Don't override QDialog::setVisible() to implement native dialogsTor Arne Vestbø2023-01-091-26/+32
| | | | | | | | | | | | | | | | | | Clients who called the base-class implementation in QDialog would as a result start hitting the canBeNativeDialog code path at the start of QDialog::setVisible(), which would show the native dialog, but without updating the QWidget visibility state. To keep things 100% compatible, we shuffle the implementation of QDialog::setVisible() into QDialogPrivate, which allows us to override it in QMessageBoxPrivate and QErrorMessagePrivate. The existing subclasses of QDialog that override setVisible have been left as is, to not cause any unintended behavior change. Pick-to: 6.5 Change-Id: Icafe31a7b84a75049365e4e04b80492de08614d2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QFileDialog: Decouple nativeDialogInUse from QPlatformDialogHelperTor Arne Vestbø2022-11-111-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QDialogPrivate::nativeDialogInUse member is used to track whether a native dialog will be used down the line when the dialog is shown, or if a native dialog is actively showing or has been shown once. The former case applies to QFileDialog and QColorDialog, which both set nativeDialogInUse based on the result of creating a platform dialog helper in Q(File|Color)DialogPrivate::init(), and then use that information to avoid creating a widget hierarchy if not needed. The latter case applies when the native dialog is attempted to be shown(), where failure to show the native dialog results in the nativeDialogInUse member being set to false. The QFontDialog and QMessageBox subclasses do not rely on the former mechanism, and will only have nativeDialogInUse set to true if the native dialog has been actively shown at least once. The QPlatformDialogHelper on the other hand, tracked by the member QDialogPrivate::m_platformHelper, does not map 1:1 to the state of nativeDialogInUse, as in the case of QPlatformFileDialogHelper there is also functionality in the helper to give hints to the widget-based non-native dialog on how to behave. As a result, we can have a valid m_platformHelper, but with nativeDialogInUse being false. To decouple this and simplify the code we let QFileDialog::setOption() reset the nativeDialogInUse based on QDialog::DontUseNativeDialog, just like QColorDialog does, and let QFileDialogPrivate::createWidgets() proceed without having to delete the platform helper, which would otherwise be necessary to reset nativeDialogInUse. The only side effect of this is that a widget-based non-native dialog will still have a QPlatformFileDialogHelper alive, but since this dialog is not going to be shown this should not be an issue in practice. Task-number: QTBUG-108153 Change-Id: I96af6cfa715717c0907fe840aa86d4e5b280d54c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Make QDialog respect Qt::AA_DontUseNativeDialogsTor Arne Vestbø2022-11-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QDialogs can be backed by native dialog helpers, and the choice of whether to use a particular helper is a runtime decision, made in QDialog::setVisible() via QDialogPrivate::canBeNativeDialog(). As the native dialogs may not always provide every feature of the corresponding Qt dialog, or if the user wants a uniform look and feel for their application (even if that breaks the platform UX), there is a way to opt out, via the Qt::AA_DontUseNativeDialogs attribute. This attribute was checked by subclasses of QDialog/QDialogPrivate, for example QFileDialog or QColorDialog, but not by the base class implementation, which is being used by e.g. QMessageBox. Ideally we'd reduce the amount of code duplication in this area, by having subclasses such as QFileDialog and QColorDialog call the base class implementations, but for now we add a similar check for the attribute to the base class as we have in other leaf classes. [ChangeLog][Widgets] QMessageBox now respects the Qt::AA_DontUseNativeDialogs application attribute to opt out of native message boxes on platforms where this is supported (iOS, Android). Change-Id: I0080441ea8764e9d5fc62d7f2d7b8914a5844c28 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Replace QT_NO_ACCESSIBILITY with QT_CONFIG(accessibility)Allan Sandfeld Jensen2022-06-151-3/+3
| | | | | | | Pick-to: 6.4 Change-Id: Iee4bd8970810be1b23bdba65a74de912401dca65 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Doc: Remove mentioning of Fowler bookKai Köhne2022-01-171-2/+1
| | | | | | | | | It is out of print since years, and probably quite dated by now (released 1997). Pick-to: 6.3 Change-Id: I1653eb404713c15d70b8a15858e8c7d12b2e71cb Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Don't hide dialogs before closing themTor Arne Vestbø2021-10-181-1/+7
| | | | | | | | | | | | | | | | | | | When a dialog was accepted or rejected via done(), we used to only hide it, but as of 0246bfd40a2cc5ea9cfc035146e6dd865b334c68 we now close it. Closing a widget results in hiding it as part of handleClose, so we do not need to explicitly hide it before calling close(). In fact doing so prevents the lastWindowClosed logic from checking whether the window was visible before handling the close event, which is documented to be a requirement for a window triggering lastWindowClosed. We still need to hide the widget in case we don't end up closing it ourselves, to ensure QDialog::closeEvent accepts the close. The reason for the code in closeEvent seems a bit dubious, but that's left for future adventures. Change-Id: Ic32b965d495c08996c3a199bbee798df0206216c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* widgets: Fix typos in source code commentsJonas Kvinge2021-10-151-1/+1
| | | | | | Pick-to: 6.2 Change-Id: I22f71a53b0f7f0698450123343e25548c889c3e2 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix references to QGuiApplication::lastWindowClosedTor Arne Vestbø2021-10-131-1/+1
| | | | | | | | | The signal is emitted from QGuiApplication these days. Pick-to: 6.2 Change-Id: I7423cd4808e8df86960f225fd6e4a12a1a4f11f3 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QDialog: respect WA_ShowWithoutActivatingVolker Hilsheimer2021-10-111-32/+37
| | | | | | | | | | | | | | | | | | QDialog overrides setVisible to set focus on the default push button, or (if there is no such button), make the first autoDefault push button the default button. QDialog also explicitly sends a FocusIn event to the focus widget in the dialog. All this should not be done if the dialog does not become active after getting shown, which will be prevented if the WA_ShowWithoutActivating attribute is set. Add a test case. Fixes: QTBUG-8857 Pick-to: 6.2 Change-Id: If47021a4721a280ba45e95b43d0424cdacd9b4ea Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Close QDialog via QWidget::close()Tor Arne Vestbø2021-09-161-4/+21
| | | | | | | | | | | | | | | By going via QWidget::close() we ensure that if there's a QWidgetWindow backing the dialog (which is almost always the case), we will plumb down to QWindow::close(), resulting in QEvent::Close events to the QWindow. Since we don't want QDialog subclasses to receive a call to a closeEvent override that they didn't receive before (and which they might interpret as rejection or cancellation), install a temporary event filter that eats the QCloseEvent resulting from the call to close(). Task-number: QTBUG-53286 Change-Id: Ie8f6f0cb3160acfd5865dc74f0a7b6d87f838724 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Split up close handling in QWidget into a pre and post stepTor Arne Vestbø2021-09-071-1/+1
| | | | | | | | | | If we are the one initiating the close (from Qt Widget land), we want to mark the widget as closing as early as possible. Clarified the role of close_helper by renaming it to handleClose. Change-Id: Iae250a0ae1583d743c59e99fcb99fdf18d2a1882 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Dialog: Fall back to transient parent to make dialog window get centeredYuya Nishihara2020-12-031-1/+14
| | | | | | | | | | | | | | | Unlike QWidget-based application, a dialog displayed in QML app doesn't have QWidget parent, so it would be centered in the current screen. Let's fall back to transient parent window if widgetParent() is missing. It's tempting to rewrite adjustPosition() to not depend on QWidget at all, but that seems not easy. Lookup path of window() and transientParentWindow() is slightly different for example, and QWidget::pos() is used instead of mapToGlobal({0, 0}) if the widget is embedded into a native window. Fixes: QTBUG-63406 Change-Id: If72d90aee8d972240243184de4d3c09d77f704ff Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Remove usage of QDesktopWidget(Private) from most places in QtWidgetsVolker Hilsheimer2020-07-071-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Call QGuiApplication and QScreen APIs directly to get geometries, and make use of QScreen::grabWindow grabbing the screen it's called on when called with WId == 0. This assumes that QGuiApplication::screen and QWidget::screen never return nullptr, which is already assumed in other places. In QSplashScreen, simplify the code to operate on the screen of the QSplashScreen itself. Remove the case that handles a QDesktopWidget parent - QSplashScreen doesn't have a constructor that takes a QWidget* parent anymore. In the QEffect implementation, we can rely on the widget pointer not being nullptr (it's tested in the free functions client code uses). Includes a few drive-by changes to coding style and logic in qtooltip.cpp, where the tip label placement now prefers the screen of the widget the label is created for, and uses the position only as a fallback. What remains is the special handling of QDesktopWidget and the Qt::Desktop type in QWidget and QApplication. Change-Id: I30b67bab8ae82ddfcc7bbbec3c10f6e935b74f06 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Phase 2 of removing QDesktopWidgetVolker Hilsheimer2020-06-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove QDestopWidget public header, simplify the implementation that maintains a Qt::Desktop type QWidget for each QScreen, and turn QWidget's initial target screen into a QScreen pointer. QApplication::desktop() now takes an optional QScreen pointer, and returns a QWidget pointer, so that applications and widgets can get access to the root widget for a specific screen without having to resort to private APIs. QDesktopWidgetPrivate implementations to look up a screen for an index, widget, or point are now all inline functions that thinly wrap QGuiApplication::screens/screenAt calls. We should consider adding those as convenience APIs to QScreen instead. Note that QWidget::screen is assumed to return a valid pointer; there is code that handles the case that it returns nullptr (but also code that trusts that it never is nullptr), so this needs to be defined, verified with tests, and asserted. We can then simplify the code further. Change-Id: Ifc89be65a0dce265b6729feaf54121c35137cb94 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Reduce QDesktopWidget API to bare minimumVolker Hilsheimer2020-05-151-1/+1
| | | | | | | | | | | | | | | | | The class is documented as obsolete, and the majority of APIs is marked as deprecated. In this first phase, remove all explicitly deprecated APIs and trivial implementations. The test case is complete removed; what's left when code that uses any of those deprecated methods is removed is not testing anything meaningful. For some methods, there is no practical replacement using QScreen yet, and QDesktopWidget is still used in QWidget internals. Those require refactoring to only use QScreen before the rest can be removed. Change-Id: I8f7c968ec566820077221d37b817843758d51d49 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove deprecated members from dialog classesVolker Hilsheimer2020-04-161-153/+0
| | | | | | | And a few cleanups of out-dated comments and dead code. Change-Id: I59c6b9129a21b8953626cb63c3ebbf9b6c49a657 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Replace usages of QVariant::value by qvariant_castOlivier Goffart2019-12-151-1/+1
| | | | | | | This is done automatically with a clazy check Change-Id: I3b59511d3d36d416c8eda74858ead611d327b116 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Tidy nullptr usageAllan Sandfeld Jensen2019-12-061-7/+7
| | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QtWidgets: Fix static method invocationsFriedemann Kleint2019-06-281-3/+3
| | | | | | | | | | | | | | | | | | | | | Apply fixits by Creator and results of manual search focusing on QCore/Gui/Applicaton(Private) methods and variables to prepare for splitting out some classes. Task-number: QTBUG-69478 Task-number: QTBUG-76497 Task-number: QTBUG-76493 Change-Id: Iaf468166793e0cabb514b51c827b30317bf45a2d Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-03-141-0/+7
|\ | | | | | | | | | | | | Conflicts: src/corelib/tools/qcollator_win.cpp Change-Id: I6d806d7c58b2057ebde3ad915bb5551f34b700e5
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-03-091-0/+7
| |\ | | | | | | | | | Change-Id: Ica3f89ace33585ad7854417a328156f5a68e2a00
| | * Document that dialog parent relationship does not imply stacking orderTor Arne Vestbø2019-03-061-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On macOS, and most probably some X11 window managers, the parent/child relationship of the dialog is not possible to propagate to the platform, and the only determining factor of whether or not the windows stack on top of each other is the modal state of the window. Task-number: QTBUG-34767 Change-Id: I8b4b4910e3f905c44e577544fc347dbded373848 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-03-091-3/+3
|\| | | | | | | | | | | Change-Id: I056b658ffe9390dfcbe2787e2bddc7f4e9b389dd
| * | Fix some qdoc warningsFriedemann Kleint2019-03-071-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/corelib/itemmodels/qtransposeproxymodel.cpp:166: (qdoc) warning: Unknown command '\details' src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp:102: (qdoc) warning: '\brief' statement does not end with a full stop. src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp:233: (qdoc) warning: Undocumented parameter 'index' in QConcatenateTablesProxyModel::flags() src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp:165: (qdoc) warning: Undocumented parameter 'proxyIndex' in QConcatenateTablesProxyModel::mapToSource() src/corelib/io/qresource.cpp:275: (qdoc) warning: Can't link to 'isCopressed()' src/corelib/io/qresource.cpp:555: (qdoc) warning: Can't link to 'compressionType()' src/network/ssl/qocspresponse.cpp:47: (qdoc) warning: '\brief' statement does not end with a full stop. src/network/ssl/qocspresponse.cpp:47: (qdoc) warning: Can't link to 'QSslSocket::ocspResponse()' src/gui/image/qimage.cpp:2247: (qdoc) warning: Undocumented parameter 'f' in QImage::convertTo() src/gui/image/qimage.cpp:2247: (qdoc) warning: No such parameter 'format' in QImage::convertTo() src/gui/text/qtextformat.cpp:1420: (qdoc) warning: Undocumented parameter 'styleName' in QTextCharFormat::setFontStyleName() src/gui/text/qtextformat.cpp:1420: (qdoc) warning: No such parameter 'style' in QTextCharFormat::setFontStyleName() src/widgets/dialogs/qdialog.cpp:151: (qdoc) warning: Unknown command '\p' src/widgets/dialogs/qdialog.cpp:167: (qdoc) warning: Unknown command '\p' src/widgets/dialogs/qdialog.cpp:167: (qdoc) warning: Unknown command '\p' src/widgets/dialogs/qdialog.cpp:168: (qdoc) warning: Unknown command '\p' Change-Id: Ide52b70f8e72d53767d489ce1a413cf4c2dce7df Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | | Doc: Minor QDialog clarificationPaul Wicking2019-03-041-6/+5
|/ / | | | | | | | | | | | | | | Minor rewrite of a bit that caused some confusion. Fixes: QTBUG-73335 Change-Id: Ic1df44e62a29035c7b93052204fbe9ef72db5f40 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | QtWidgets: Fix deprecation warningsFriedemann Kleint2019-03-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix deprecation warnings where possible or add warnings scopes, fixing: dialogs/qdialog.cpp:783:41: warning: ‘void QDialog::showExtension(bool)’ is deprecated [-Wdeprecated-declarations] ^~~~~~~~~~~~~ widgets/qcombobox.cpp:1386:37: warning: ‘void QComboBox::currentIndexChanged(const QString&)’ is deprecated: Use currentTextChanged() instead [-Wdeprecated-declarations]= dialogs/qfiledialog_p.h:168:38: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:590:38: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:617:27: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:617:27: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:645:27: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:1730:17: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:2637:43: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:2750:10: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:2786:49: warning: ‘bool QFileDialog::confirmOverwrite() const’ is deprecated: Use !testOption(DontConfirmOverwrite) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:3654:27: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:3843:48: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:3895:72: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] styles/qwindowsstyle.cpp:836:19: warning: ‘PE_IndicatorViewItemCheck’ is deprecated [-Wdeprecated-declarations] graphicsview/qgraphicswidget.cpp:2309:51: warning: ‘PM_MDIFrameWidth’ is deprecated [-Wdeprecated-declarations] styles/qstylesheetstyle.cpp:4302:10: warning: ‘PE_FrameStatusBar’ is deprecated [-Wdeprecated-declarations] styles/qfusionstyle.cpp:3676:10: warning: ‘SH_ScrollBar_StopMouseOverSlider’ is deprecated [-Wdeprecated-declarations] Change-Id: I9e15f4a0996476ec88d8823b72f0c537dce97b9c Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* | QtWidgets: compile with QT_DISABLE_DEPRECATED_BEFORE=0x050d00Christian Ehrlicher2019-02-131-0/+2
| | | | | | | | | | | | | | | | Don't call or implement functions which are not available when compiling with QT_DISABLE_DEPRECATED_BEFORE=0x050d00 Change-Id: If427e20774b358dc16fa1c7d7ba8c0feba3e144b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | QtWidgets: mark QDialog/QFileDialog functions as deprecatedChristian Ehrlicher2019-02-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Mark some long obsolete functions as deprecated so the can be removed with Qt6: - QDialog::setOrientation()/orientation() - QDialog::setExtension()/extension()/showExtension() - QFileDialog::setNameFilterDetailsVisible()/isNameFilterDetailsVisible() - QFileDialog::setResolveSymlinks()/resolveSymlinks() Change-Id: Ibbd5b4192ea8ab483d6b2a8dbf9879f29f9ee86d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QtWidgets: replace 0 with \nullptr in documentationChristian Ehrlicher2019-02-051-2/+2
| | | | | | | | | | | | | | | | | | Replace 0 with \nullptr in the documentation. As a drive-by also replace some 0 with nullptr in the corresponding code. Change-Id: I5e5bc1ae892f270d7c3419db1c179053561f1b26 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2019-01-211-1/+1
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ibfcb30053f3aacb8ec2ec480e146538c9bf440ea
| * Documentation: Add \nullptr macro and use where applicableFriedemann Kleint2019-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt for Python users reading the documentation assume that int(0) can be passed for pointer parameters. Use the newly introduced \nullptr to disambiguate this. In a follow-up step, the \nullptr macro can be defined as None when generating the Qt for Python documentation. Task-number: PYSIDE-903 Change-Id: I3a45f87175a0668ab5f3f95f0aff409f7e3ef027 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-041-14/+43
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also blacklist tst_QRawFont::unsupportedWritingSystem() and tst_QGlyphRun::mixedScripts() on windows for now. Conflicts: qmake/generators/makefile.cpp src/corelib/itemmodels/qstringlistmodel.cpp src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp tests/auto/gui/text/qglyphrun/BLACKLIST tests/auto/gui/text/qrawfont/BLACKLIST Task-number: QTBUG-72836 Change-Id: I10fea1493f0ae1a5708e1e48d0a4d7d6b76258b9
| * Respect roles of buttons added to QMessageBoxVitaly Fanaskov2019-01-031-11/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a button added to QMessageBox has AcceptRole or YesRole, the signal accepted() will be emitted upon click on the button. If the button has RejectRole or NoRole, the signal rejected() will be emitted upon click on the button. If a button has a different role, neither accepted() nor rejected() will be emitted. This works for both standard and custom buttons. The signal finished() with result code will be sent regardless of a clicked button role. Also added documentation strings for some methods of private classes in order to have better tooltips in IDE(s). Task-number: QTBUG-44131 Change-Id: I521a4e5112eb4cf168f6fbb4c002dbe119aeeb09 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * QDialog: Pass transient parent as a parent to native dialogsAlexander Volkov2018-12-241-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes it's needed to show a native dialog for another process, for example in xdg-desktop-portal-kde. In this case we have WId of a parent window which can be used for calling QWindow::setTransientParent(QWindow::fromWinId(...)). Pass this transient parent to a native dialog so it could use it as a transient parent for itself. Rename QDialogPrivate::parentWindow() for clarity. Change-Id: I68974ddea35f9366a0ddffe602d9d028f45e26fa Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Allow to prevent blocking of native dialogs by a proxy Qt dialogAlexander Volkov2018-10-021-0/+19
|/ | | | | | | | | | | | | | | | When native dialogs become visible, their invisible proxy Qt dialog blocks input to Qt windows. It is intended for native dialogs which can't block Qt windows themselves, e.g. on Android. But this behavior is incompatible with native dialogs which are implemented as in-process Qt windows, because the proxy dialog blocks them as well. This change introduces QPlatformDialogHelper::DialogIsQtWindow style which allows to detect such cases and prevent blocking. Change-Id: I8f1f741e05d09f2c27192890bcec35fdd2e8f074 Task-number: QTBUG-58116 Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net> Reviewed-by: David Faure <david.faure@kdab.com>
* Fix build with '-no-feature-action' configurationValentin Fokin2018-07-121-0/+4
| | | | | | | Task-number: QTBUG-68353 Change-Id: Ia949e4a72a363df5fba86504e5f7e3ce8a3ad347 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* QDialog::done(): improve the docsGiuseppe D'Angelo2018-06-071-3/+6
| | | | | | | Explain that finished() will also be emitted. Change-Id: Ic6b55fee8b3af59d989e074e52da7a4398a3052a Reviewed-by: hjk <hjk@qt.io>
* Add a note to QDialog::exec() to prefer open() insteadGiuseppe D'Angelo2018-05-151-0/+7
| | | | | | | | | | QDialog::exec() has a number of problems due to spinning an inner event loop (to counteract its being synchronous). We've had QDialog::open() as a better alternative for a long while now, so encourage people to use that instead. Change-Id: I51a69a018dcbf6133adb6c2f69c7caf442008b36 Reviewed-by: Martin Smith <martin.smith@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-09-201-8/+12
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/styles/mac/qmacstyle_mac.mm src/widgets/util/qcompleter.cpp src/widgets/widgets/qmainwindowlayout.cpp src/widgets/widgets/qmdisubwindow.cpp Change-Id: If0e96981af07ce36ac68f2e69211bc2120f93973
| * Convert features.menu to QT_[REQUIRE_]CONFIGStephan Binner2017-09-191-1/+3
| | | | | | | | | | Change-Id: I031356411294b259ebd2b22c53159c93fd92af6e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * Convert features.sizegrip to QT_[REQUIRE_]CONFIGStephan Binner2017-09-121-7/+9
| | | | | | | | | | Change-Id: Ieac4ae1f0b8b84e943c00da9903346a44e57138c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Reduce usage of QDesktopWidget to resolve screen properties in QtWidgetsTor Arne Vestbø2017-08-181-5/+6
|/ | | | | | | | | | | Removes the need to initialize QDesktopWidget, just to look up which screen a widget would map to, the geometry of a screen, number of screens, etc. Change-Id: Ieb153b9ff6d3fba645fc528d6e430e8392f990bf Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Convert features.fontdialog to QT_[REQUIRE_]CONFIGStephan Binner2017-07-111-1/+3
| | | | | Change-Id: Iebc091ffd023595278fa177b7f205b6e0cd7ec52 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.errormessage to QT_[REQUIRE_]CONFIGStephan Binner2017-07-021-1/+3
| | | | | Change-Id: I9cc4f5190108c4bb96ddbd782ef1a031c9889f7e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>