summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs
Commit message (Collapse)AuthorAgeFilesLines
* Widgets: Improve usage of string view typesAnton Kudryavtsev2024-04-082-3/+3
| | | | | | | Use string views in QFontDialog, QColorDialog and QCommonStyle Change-Id: I22f4b4694e2d18b784aaa85aebff8d92b8f0b871 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Don't accept QFileDialog when disabled item is activatedKeith Kyzivat2024-03-211-2/+3
| | | | | | | | | | | | | On macOS, entries that do not match the filter are shown in the directory listing. Do not accept the dialog when these entries are double-clicked (activated). Pick-to: 6.7 6.6 6.5 Fixes: QTBUG-120768 Change-Id: If8ff6c56f1d21861b4e30051c212c9497042ed0f Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* QMessageBox: Respect explicit accept/reject after closing dialogTor Arne Vestbø2024-03-141-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the dialog is closed by pressing a button, the button will be reflected via clickedButton(), and the result() will reflect either the QMessageBox::StandardButton value, or an opaque value for custom buttons. Depending on the role if the buttons, the accepted or rejected signals are emitted. If the user called accept() or rejecct() on a dialog that had already been closed by a button, we would as a result of 1f70c073d4325bc0eb9b0cec5156c3b89ce1b4df emit a signal based on the original button that was clicked, instead of respecting the newly triggered function. It's a questionable use-case, as the clickedButton() is still the original button e.g., but we should still avoid regressing this, so we now emit the signals based on the newly stored result code instead of using the clicked button as the source of truth. To allow this we had to change the opaque result() value for custom buttons to stay out of the QDialog::DialogCode enum, but this should be fine as the documentation explicitly says that this is an opaque value. Fixes: QTBUG-118226 Pick-to: 6.7 6.6 6.5 Change-Id: Ia2966cecc6694efce66493c401854402658332b4 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* QMessageBox: ensure setTextFormat() also apply to informative textWang Zichong2024-03-141-2/+9
| | | | | | | | | | | QMessageBox::setTextFormat can set the text format for its text label, but the informative label will still use its default text format. This change allow the setTextFormat also apply to the informative label, thus user can use their preferred format like Markdown in the informative label. Task-number: QTBUG-122712 Change-Id: I6f7487b29712ca07cee27171453312ff1707eea3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Mention QChronoTimer in API docsAhmad Samir2024-03-031-4/+5
| | | | | Change-Id: Iaf9fb31994f1580b2051dbd0b1b8eef2a218aa39 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix -Wimplicit-fallthrough for clangTim Blechmann2024-03-011-0/+1
| | | | | | | | | | | | | | | | | | | Clang's `-Wimplicit-fallthrough` warnings are a little stricter than gcc's interpretation: switch (i) { case 0: foo(); case 4: break; } While gcc accepts the implicit fallthrough, if the following statement is a trivial `break`, clang will warn about it. Pick-to: 6.7 Change-Id: I38e0817f1bc034fbb552aeac21de1516edcbcbb0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QMessageBox: Forward helper checkbox state via lambdaTor Arne Vestbø2024-02-291-2/+7
| | | | | | | | | | | | There may not be a checkbox when the helper is initialized, and we want to support the case of a checkbox being added at a later stage. Regression from e5c40ec5c117376f401c01069f05780046d07094. Pick-to: 6.7 Change-Id: I397c3b3a101b249aab17804bd90085cfd4ab7dbb Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* qmessagebox.h: Remove redundant semicolon after Q_ENUMAxel Spoerl2024-02-271-1/+1
| | | | | | | | | | | | A redundant semicolon after Q_ENUM(StandardButton) caused a compiler warning. Remove it. Fixes: QTBUG-122637 Pick-to: 6.7 6.6 6.5 Change-Id: I959c0c6d56bc312ad40f18c9455f4e6118b1c7c2 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* QErrorMessage: Honor devicePixelRatio for SP_MessageBoxInformationChristian Ehrlicher2024-02-191-1/+3
| | | | | | | | | Use QStyle::standardIcon() and retrieve the best icon based on the current dpr instead standardPixmap() which does not know anything about the dpr. Change-Id: Icbc6fd0e7b14808aaa4f081ed5079c319207828a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Mention AA_DontUseNativeDialogs in QFileDialogKai Köhne2024-02-191-4/+7
| | | | | | | Pick-to: 6.5 6.6 6.7 Task-number: QTBUG-119551 Change-Id: I54f7e8f4b855b15d22b2180095cbf454b31412c3 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Clean up about Qt dialog textKai Köhne2024-02-141-6/+5
| | | | | | | | * Use https instead of http * End Ltd with a dot (it's an acronym) Change-Id: Ie94b57245b37461a2ca3af629879d886060f9fe3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove year from generic Qt copyright informationKai Köhne2024-02-141-1/+1
| | | | | | | | | | | | | While at it, also add the missing dot in Ltd. (as it's an abbreviation). Also, prefer https:// over http://. Fixes: QTBUG-121906 Task-number: QTBUG-121928 Pick-to: 6.7 6.6 Change-Id: I4e1f1563376ae36b3c260359d830f00969ab9351 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix build with -no-feature-menuTasuku Suzuki2024-02-021-0/+2
| | | | | Change-Id: I29a230d70a96c3037f4e07dbe23fce13aa869089 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QFileSystemModel: don't crash with setIconProvider(nullptr)Ahmad Samir2024-02-011-4/+7
| | | | | | | | | | | | | | | | | | | | The method takes a pointer, so the code shouldn't crash when passed a nullptr. QFileInfoGatherer::getInfo() still needs to generate a descriptive string for the file, so we refactor QAbstractFileIconProvider::type() to put the implementation into a reusable static function QAbstractFileIconProviderPrivate::getFileType(const QFileInfo &info). This unfortunately involves constructing a QMimeDatabase on the fly, but the docs say that is fine. Drive-by change: use nullptr instead of `0` for pointers. Pick-to: 6.5 6.6 6.7 Fixes: QTBUG-99178 Change-Id: Ia32ea0a26701d593e74fbecced7be8d9e0aa0f52 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Widgets: Add missing deprecation version markersKai Köhne2024-01-281-4/+4
| | | | | Change-Id: I277e481c7e802f97d1394d7421e9527083df8482 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QMessageBox: Move enum static assertions to cpp fileAxel Spoerl2024-01-252-7/+14
| | | | | | | | | | | | | | | | | Move static assertions for StandardButton and ButtonRole enums from header to cpp file. Use qToUnderlying instead of casting and assert types where possible. Amends 773f9ab0189bbb439c3066695c947b11a20c484f. Found in API-Review. Change-Id: Ia52886e6e33a3b94b327d17d1453e18febe6dd50 Found-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Task-number: QTBUG-119952 Pick-to: 6.7 6.6 6.5 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QFileDialog::getOpenFileContent: default new parent parameterVolker Hilsheimer2024-01-241-1/+1
| | | | | | | | | | | | | | | | | Amends 7c5cf8cae054954975a3e262f7fe3cd9897d67f4, which removed the old function that didn't have any parent parameter from the API, and added a new one with the parent parameter in its stead. However, to make sure that the new function is source compatible with existing code, the parent parameter must be defaulted to nullptr (which it already is in the new version of saveFileContent). Found during header review. Pick-to: 6.7 Change-Id: I3e734905be9788ae1b206c7a65328e604667f5e4 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Widgets: pass widget to QStyle::pixelMetric()Christian Ehrlicher2024-01-162-3/+3
| | | | | | | | | | | | Make sure to pass the widget to QStyle::pixelMetric() as some styles might use this (e.g. the new windows styles) to determine the correct pixel metric. Pick-to: 6.7 6.6 6.5 6.2 Task-number: QTBUG-1857 Change-Id: I5c32f5af8b284749732b610e56b4e3d8c8ed1946 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
* QColorDialog: Add trailing comma to new enum valueVolker Hilsheimer2024-01-121-1/+1
| | | | | | | | | As commented in header review, this will make future header reviews less noisy. Pick-to: 6.7 Change-Id: Ia75e51facec100172de7dbb0854830d9981f0552 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* 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>
* QColorDialog: Use pmf-style connectsChristian Ehrlicher2024-01-102-45/+43
| | | | | | | | Port all string-based signal/slots connections to pmf-style connects. Pick-to: 6.7 Change-Id: If1075a5a8a4d018e060e7d18ee59c8fc4c0a5207 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* QSidebar: Use pmf-style connectsChristian Ehrlicher2024-01-102-21/+27
| | | | | | | | Port all string-based signal/slots connections to pmf-style connects. Pick-to: 6.7 Change-Id: I4ebabf1b117f86f39d3875965efa8ee5042bce84 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* QInputDialog: Use pmf-style connectsChristian Ehrlicher2024-01-102-34/+35
| | | | | | | | | Port all string-based signal/slots connections to pmf-style connects. Exception: Private::ensureEnabledConnection(QAbstractSpinBox*) Pick-to: 6.7 Change-Id: Id88fe88a1f9071085a159e1fa6429a6ec02e61bb Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* QFontDialog: Use pmf-style connectsChristian Ehrlicher2024-01-103-34/+36
| | | | | | | | Port all string-based signal/slots connections to pmf-style connects. Pick-to: 6.7 Change-Id: Ic7ecfd1efb8eb76239598e48f25251357040f814 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* QFileDialog: Use pmf-style connectsChristian Ehrlicher2024-01-103-170/+163
| | | | | | | | Port all string-based signal/slots connections to pmf-style connects. Pick-to: 6.7 Change-Id: I6121e727c2730f9e5947f9f3b7550903bb17aee0 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* QMessageBox: Use pmf-style connectsChristian Ehrlicher2024-01-102-23/+14
| | | | | | | | Port all string-based signal/slots connections to pmf-style connects. Pick-to: 6.7 Change-Id: I7d77c2a10ed0c27422893403dfc9c5a6d43ea798 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Add parent arg to QFileDialog::getOpenFileContent and saveFileContentChris Von Bargen2023-12-282-15/+32
| | | | | | | | | | | | | | | | | | | | | | | | | This change updates getOpenFileContent to provide a parent when the non-WASM fallback to a QFileDialog is created, which avoids issues where this call is made inside another application. Specifically, if a QDialog is created lacking a parent to the main window, it will prevent interaction with that dialog. This patch addresses that problem with window modality. This change also updates saveFileContent to provide a parent for the fallback mechanism, so that both static APIs that interact with WASM/non-WASM dialogs have comparable behavior. The new parent argument is updated in the documentation. Documentation is clarified in terms of usage outside Qt for WebAssembly. [ChangeLog][QtWidgets][QFileDialog] Adds an overload to the static methods getOpenFileContent and saveFileContent with a new parent argument which always no-ops in the WASM environment. Fixes: QTBUG-118396 Pick-to: 6.7 6.6 6.5 Change-Id: Ic59aee386631172d4a29b42fe11e5af318474a1d Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Doc: Improve documentation for QFileDialog::OptionKai Köhne2023-12-281-23/+27
| | | | | | | | | | | | | | | | | | Do not add new paragraphs in the \value description, which breaks the generated HTML table. Instead, use \br more often to break overly long lines. Replace 'option is only valid' or 'supported' by 'effective' and 'used'; if an enum doesn't apply to a dialog or platform it will just be ignored, but it's OK to set it. Fix link to DontUseCustomDirectoryIcons enum. Pick-to: 6.5 6.6 6.7 Task-number: QTBUG-119551 Change-Id: Iac86a85c7b3b402997fa14f4c4e2fa7111c62e9e Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* QDialogButtonBox: Fix focus chain and default button assignmentAxel Spoerl2023-12-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDialogButtonBox::layoutButtons() rebuilds the focus chain based on the button layout. It relied on the fact that the last button in the layout would point back to the first button. That is not the case, if - a focus frame gets inserted in the chain, and - the default button is not at the layout's first (=left) position. In that case, the chain stops at the button left of the default button. The default button can not be reached by tabbing forward. Back-tabbing still worked. By not "closing" the focus chain, the focus proxy was set to the first button found in the layout. That is wrong, whenever the default button is not at the first layout position. When the box got focus for the first time, pressing "Enter" could lead to a non-default button being triggered. A Yes/No message box would have No as its default button. On Linux, it would pop up with "No" being highlighted, but "Yes" having focus. Pressing Enter would trigger Yes, instead of No. tst_QMessageBox::staticSourceCompat() heuristically defines the button expected to be triggered by Enter. On Linux/KDE, it would pass, when the wrong button was fired. => Always "close" the focus chain, by linking the last and first buttons. => Make the default button the button box's focus proxy. => Change tst_QMessageBox::staticSourceCompat() to always expect No being fired by Enter in a Yes/No box. [ChangeLog][QtWidgets][QDialogButtonBox] Default button becomes focus proxy of a QDialogButtonBox. This ensures that Enter triggers the default button, instead of the first button in the layout. Fixes: QTBUG-118489 Pick-to: 6.7 6.6 6.5 Change-Id: Ic626d3d0fe7ba8b924c21734332e98532f11c80e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Pass correct default button in QMessageBox::showNewMessageBox()Axel Spoerl2023-12-201-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | showNewMessageBox() shows an "old" message box, if a default button argument was passed and the buttons argument doesn't contain a default button. It passed the int value of defaultButton to showOldMessageBox, where it was interpreted as a normal button. The StandardButton::Default flag was not set on the default button. This relied on the QDialogButtonBox owned by QMessageBox to show the expected default button by co-incidence. As this was not always the case, tst_QMessageBox::staticSourceCompat() even tested wrong expected results. => Add the Default flag to the default button, before passing it as an int value. => As a drive-by, - replace c-style casting with static casting. - add braces to multi-line if clause. Task-number: QTBUG-118489 Pick-to: 6.7 6.6 6.5 Change-Id: I9cf93c8f93d6ab80e7be5ab25e56bc59d3d6209c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Add missing full stop to briefsPaul Wicking2023-12-201-1/+1
| | | | | | | | | | | | | | QDoc generates missing full stops for briefs in certain situations. Due to how the `\brief` command works, this fails if the brief ends with a link target. As this is a corner case, add the missing full stop to the offending briefs. Task-number: QTBUG-117636 Task-number: QTBUG-117470 Change-Id: I6d9538f517cd39943ab817f45183fadd3b3a9c92 Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io> Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Fix linking to QFileDialog::NativeFileDialogKai Köhne2023-12-191-2/+2
| | | | | | | | Pick-to: 6.5 6.6 6.7 Task-number: QTBUG-119551 Change-Id: I1c698673873e5534b6d7867f8bc752115c254241 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Inkamari Harjula <inkamari.harjula@qt.io>
* QMessageBox: don't use a native dialog if a style sheet is activeVolker Hilsheimer2023-12-141-0/+1
| | | | | | | | | | | | | | | | | With 6.5 we try to use the native message dialog if we can, but we didn't account for the style sheet. This restores pre-6.5 behavior for QMessageBox. Other dialogs will continue to be native, even if a style sheet is in use. While this is inconsistent, the other dialogs are substantially more functional, so switching to the Qt version because of a style sheet being active would be a significant change of behavior. Pick-to: 6.7 6.6 6.5 Fixes: QTBUG-120054 Change-Id: I07eae609bc360140e096c5eb7ad004ffa4422123 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Review and improve QFileDialog documentationInkamari Harjula2023-12-141-120/+123
| | | | | | | | Grammar improvements made. A screenshot added. Task-number: QTBUG-119551 Change-Id: Ia14c654e92eede5a32bba18cd4d05a74d289f64b Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io>
* Doc: Add AcceptMode info to DontConfirmOverwriteSafiyyah Moosa2023-12-131-1/+2
| | | | | | | | | | | | When QFileDialog::DontConfirmOverwrite is in the false state (default state), it requires QFileDialog::AcceptMode to be set to QFileDialog::AcceptSave. This information was not stated in the documents and this fix adds this information to the docs. Fixes: QTBUG-49720 Pick-to: 6.5 6.6 6.7 Change-Id: I1017252980810e712f2710751c8852dd12eaeef7 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QMesageBox: add Q_ENUM and sync assertionsAxel Spoerl2023-11-231-0/+11
| | | | | | | | | | Add Q_ENUM to StandardButton and ButtonRole. Add static assertion to enforce sync with QDialogButtonBox. Task-number: QTBUG-118489 Pick-to: 6.6 6.5 Change-Id: I38a7367d6287ab7fa5e5ca0c94ea6daa0f95fc52 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QColorDialog: use std::array instead QPolygonChristian Ehrlicher2023-11-161-4/+3
| | | | | | | | Use std::array<QPoint, 5> instead a dynamic QPolygon since there is no dynamic allocation needed here. Change-Id: Iaa6fce9e0e769f2a5dd47de083208457b430f3c3 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Fix build with -no-feature-menuTasuku Suzuki2023-11-161-0/+2
| | | | | Change-Id: If207eac9a237986d51de4665b2f6749fb4e8e2d2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QMessageBox: Detect modifications to standard button textTor Arne Vestbø2023-10-311-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The addButton(StandardButton) and button(StandardButton) APIs return a QAbstractButton, that the user can in theory modify to their heart's content. This causes problems when the native dialog backend is not aware of these modifications. We documented this limitation in e9a1c5321, but it turns out to be more common than we first though. In particular, a typical case is modifying the text of the button. We now try to detect if the button has a non-standard text, and if so turn it into a custom button when passing it on to the native backend. From the point of view of QMessageBox it's still a standard button, and will be reported as such in the result of exec(). To make this work the QMessageDialogOptions::CustomButton needs to learn about custom button identifiers, so we can pass the original standard button though. This moves us closer to a world where the QMessageDialogOptions represent both standard buttons and custom buttons using the same structure, which is what we want anyways, so that we e.g. respect the added order of standard buttons with the same role. Pick-to: 6.5 6.6 Change-Id: Ifb7f7bd537fe71293f14ef6a006999e350bd0b52 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Teach QMessageDialogOptions about default and escape buttonsTor Arne Vestbø2023-10-261-6/+33
| | | | | | | | | | | | | | | | | | There's logic in QMessageBox to resolve the default and escape button if not set by the user. And the user may of course override these. We now propagate the resulting buttons via the dialog helper, and pick them up in the macOS native dialog backend. The only common information we have between the standard buttons and custom buttons is the button identifier, which for standard buttons is the enum value, and for custom buttons is an auto generated identifier. The same identifier is used when reporting the clicked button from the native dialog helper. Fixes: QTBUG-118308 Pick-to: 6.6 6.5 Change-Id: I5ca45604b51f0bbf74e56134d7b55bb8911f3563 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QMessageBox: Do last minute setup in setVisible instead of showEventTor Arne Vestbø2023-10-261-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | The native message dialogs are shown in QMessageBox::setVisible, instead of plumbed via e.g. QWidgetPrivate::show_sys (which is not virtual). And we try to show the native dialog before we call the base class QDialog::setVisible(), where we end up sending the show event. As the native dialogs might rely on the last minute setup of adding an OK button or detecting the escape button, we need to do it in setVisible instead. We can not switch the order of showing the native dialogs after calling the base class setVisible (and getting showEvent), as we need to know whether the native dialog could be shown or not to decide whether to show the fallback widget dialog. The part from showEvent that added the detailsButton has been removed, as we're already doing that in setDetailsText(). Pick-to: 6.5 6.6 Change-Id: I23f1d87d542d9dadfd71924f8119c22720f4b276 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* QMessageBox: Opt out of native dialog if standard buttons have menuTor Arne Vestbø2023-10-251-1/+1
| | | | | | | | | Amends 2d59f2e8caed71d4eceb1abe3ce17b7befb40559, which only checked this for custom buttons, but standard buttons can also be customized. Pick-to: 6.5 6.6 Change-Id: Ie8bafcf5007a0b4789b2d0ee1ddbc660a952fee4 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QMessageBox: Fall back to non-native dialog if button has menuTimur Pocheptsov2023-10-241-0/+8
| | | | | | | | | | | | | | | There's no plumbing in QMessageDialogOptions for supporting native dialog buttons with menus, and even if there was such plumbing, we don't know if our native dialogs could support them. As a workaround, detect the situation and automatically fall back to the non-native dialog, so the user doesn't need to set Qt::AA_DontUseNativeDialogs explicitly. Fixes: QTBUG-118419 Change-Id: Iece7012909261b8869ce0ca23e45e8daaf4babc7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Unify QDialog WA_WState_ExplicitShowHide handlingTor Arne Vestbø2023-10-236-21/+5
| | | | | | | | | | | | | | | | 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>
* Include what you need: <QPointer>Marc Mutz2023-10-125-0/+10
| | | | | | | | | | | | | | | | | | | | | | | All these TUs relied on transitive includes of qpointer.h, maybe to a large extent via qevent.h, though, given that qevent.h is more or less the only public QtBase header that includes qpointer.h, something else seems to be at play here. Said qevent.h actually needs QPointer in-name-only, so a forward declaration would suffice. Prepare for qevent.h dropping the include. The algorithm I used was: If the TU mentions 'passiveGrabbers', the name of the QEvent function that returns QPointers, and the TU doesn't have qpointer.h included explicitly, include it. That may produce False Positives, but better safe than sorry. Otherwise, in src/, add an include to all source and header files which mention QPointer. Exception: if foo.h of a foo.cpp already includes it, don't include again. Task-number: QTBUG-117670 Change-Id: I3321cccdb41ce0ba6d8a709cea92427aba398254 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Widgets: pass QWidget pointer to standardIcon/Pixmap() if availableChristian Ehrlicher2023-10-111-1/+1
| | | | | | | | Pass the pointer to the QWidget the icon is painted on to QStyle::standardIcon/Pixmap(). Change-Id: If9dbc3acb621fb60152f2e12fc0080f354397a99 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Fix location of QT_REQUIRE_VERSION documentationKai Köhne2023-09-221-1/+1
| | | | | | | | | | | | | | | | <QMessageBox> is not a (separately documented) header. QDoc therefore puts the documentation on a separate proxy page: https://doc.qt.io/qt-6/qmessagebox-proxy.html Fix this by actually linking to the type. This amends 95a3f85a2f, which moved the macro from QtGlobal to QMessageBox. Pick-to: 6.5 6.6 Change-Id: Ia2ed3d9fd786732c85d731634ff79afefe42333b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QMessageBox::about / aboutQt - use native modal dialog on iOSAxel Spoerl2023-09-181-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | The about / aboutQt statics in QMessageBox used a non-native, non-modal dialog box on all operating systems. This creates a grid layout with labels for heading, text and icon. This has two unwanted side-effects on iOS: - When the screen size is not sufficient to display all text, the text is not rendered. On an iPhone SE for example, only the Qt icon is visible. - When the screen height exceeds the minimum requirement, the informative text is bottom-aligned. => Show about(Qt) message boxes in a modal, native dialog. => Update documentation. This partly reverts aafed07dee5fd2d22518e49c4fa7798735e9e681. [ChangeLog][iOS] QMessageBox::about(Qt) now shows native, modal dialog. Fixes: QTBUG-115832 Pick-to: 6.6 6.5 6.2 Change-Id: I4cfbce416e7d2717058bef9a050a85d424b8a03d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add note to QMessageBox::button() about modifying returned buttonTor Arne Vestbø2023-09-081-0/+6
| | | | | | | | | | | | | | We don't have a good way to detect whether the button is modified or not, to bail out of using the native dialog helpers. Document that this API shouldn't be used to modify the standard buttons (they are standard after all), and recommend the explicit APIs for adding custom buttons instead. Pick-to: 6.6 Fixes: QTBUG-112525 Change-Id: I38c8ef5e1717a85f0db59c9e705d0775982ffb57 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* doc: Fix links to QMesssageBox::Option::DontUseNativeDialogTor Arne Vestbø2023-09-081-2/+2
| | | | | | Pick-to: 6.6 Change-Id: Icb6f28bb17ade242f6ef5dcc4ea65611a6abe9f0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>