summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* QToolTip: use qobject_cast<>/metaObject instead string compareChristian Ehrlicher24 hours2-8/+10
| | | | | | | | | | | Use qobject_cast<> or the comparision of the QTipLabel staticMetaObject pointer to determine if the object is a QTipLabel instead relying on a string compare. This will give us a compile time error when the name of this internal class changes or goes away. Pick-to: 6.11 6.10 6.8 Change-Id: Ie54342bd87fcb6688f082268464bfda5134de04c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Remove unreferenced and broken \externalpage entryJerome Pasion4 days1-6/+0
| | | | | | | | | | | -Some URLs give 404 -Some bugreports were resolved in Qt 5.1x -Some URLs no longer referenced in Qt 6 Task-number: QTBUG-142088 Pick-to: 6.11 Change-Id: Ic4ae92b3f74ce6f62484453b8943d6b149269bc3 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* QAccessibleColorWellItem: Fix translation contextFriedemann Kleint4 days1-1/+4
| | | | | | | | | | | QObject::tr() should be avoided. Amends eca2c9cfa7c7e22f0c5ebf036aad192f3c24d0e6. Task-number: QTBUG-141571 Pick-to: 6.11 Change-Id: If8ae1803ed6623e70622ccd34d65a12b957ed117 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QToolTip: misc cleanupChristian Ehrlicher4 days1-8/+2
| | | | | | | | | Remove some unneeded headers and avoid two useless conversions from/to QPoint(F). Pick-to: 6.11 6.10 6.8 Change-Id: Ieae6df74e4bd2bdba9498f86ec490520408e4c20 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QCommonStyle: use QIcon::paint() instead QPainter::drawPixmap()Christian Ehrlicher4 days1-6/+3
| | | | | | | | | No need to fiddle around with the devicePixelRatio here - QIcon does this internally. Pick-to: 6.11 Change-Id: I8ef5e9c70e073ea7edcb678e3a072f557040e1f0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Don't allocate QColorLuminancePicker::pix on the heapMichael Weghorn5 days1-9/+6
| | | | | | | | | | | | There's no reason to use a pointer for this pixmap and allocate it on the heap. Make use of the fact that a QPixmap can be a null pixmap to indicate/detect the case when no actual pixmap data are currently set. Change-Id: Ibebacfdd5ee7e8d0563197b052dde88aa8ea8c7f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QToolTip: move QTipLabel class declaration to qtooltip_p.hChristian Ehrlicher6 days3-54/+87
| | | | | | | | | | Move QTipLabel class decl out into a private header so it can be used in the style classes. Pick-to: 6.11 6.10 6.8 Change-Id: Ibed6153e899862bdd243e9d2d630305980fcb8a2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QMenu: return the triggered widget action from exec()Volker Hilsheimer8 days1-1/+5
| | | | | | | | | | | | | | | | | | | | A QMenu executed via QMenu::exec is expected to return the QAction that was triggered to close the menu. For QWidgetActions, this case is handled explicitly in the private _q_actionTriggered slot, as the mouse event is handled by the widget, and not by the menu. However, QMenu's mouse and key event handling was the only place where the current action got updated, and written also to the "syncAction" for menus opened synchronously. As a result, QMenu::exec returned nullptr if the menu was closed by triggering a widget action. Fix this by setting the current and sync action in the code that closes the menu when a widget action gets triggered. Fixes: QTBUG-141992 Pick-to: 6.11 6.10 6.8 Change-Id: Ie506b33dab8f9bd5b6fd54fd3fc91a107cbda64f Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* a11y: Notify about property/state changes of focused item view itemMichael Weghorn11 days2-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Item view item data for various roles are relevant for the properties and states reported for the corresponding accessible objects on the accessibility layer, see the a11y implementation in QAccessibleTableCell. Therefore, changes to the relevant role data should also be reported as corresponding state/property changes on the a11y layer. Implement sending corresponding accessibility events from QAbstractItemView::dataChanged. While the roles param in the QAbstractItemModel::dataChanged signal that this slot is connected to is optional, only handle roles that are explicitly passed for now, which covers the case of interactively modifying items. Properly handling the case of an empty list of roles indicating that all roles should be considered as (potentially) having been modified would require to keep track of previous values to be able to only send notifications about those that actually changed. (One way to do that for the current item could be to remember the values in QAbstractItemView::currentChanged and then compare whether those have changed in the meantime.) Always sending accessibility events even if no change actually occured would be incorrect and could e.g. result in confusing/misleading screen reader announcements. For now, in order to avoid potential negative performance implications when doing that for all items, restrict this to the case where (only) the current item's data has changed, which in particular covers the case where a user interactively modifies that item. (If the need arises, this can be further extended as needed in the future.) This e.g. makes the Orca screen reader on Linux announce changes to the checkbox state for the QTBUG-141856 sample program when toggling it using the space key, and results in the state getting updated as expected in Accerciser [1]. The accessible name shown in Accerciser also gets updated as expected when modifying an item's text, and Orca announces the new name. [1] https://gitlab.gnome.org/GNOME/accerciser Task-number: QTBUG-141856 Change-Id: Ic1592f4c639c29ab4144ae8b768f26c63f8878dc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* a11y: Unify item view to a11y child index mappingMichael Weghorn11 days7-12/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | Different QAbstractItemViewPrivate subclasses implement mapping from the item views model index to an accessible child index. So far, the methods implementing the logic were independent and used only within the corresponding item view implementations themselves. Introduce a new virtual base class method QAbstractItemViewPrivate::accessibleChildIndex and let the existing implementations override that one. This prepares for being able to make use of that logic directly inside QAbstractItemViewPrivate in an upcoming commit. While at it, also make have those methods dependent on QT_CONFIG(accessibility). Task-number: QTBUG-141856 Change-Id: Ic02a7875eccb893f722f13489f768f3675fe14bf Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Ingo Klöcker <dev@ingo-kloecker.de>
* a11y - Allow headers to be fetched by QAccessibleTable::cellAtEven Oscar Andersen11 days1-0/+31
| | | | | | | | | We are going to need this later when we need the geometry for the visible cells. Task-number: QTBUG-141125 Change-Id: I6c12640405d902b84f241dadb4b4fe988535af0a Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Fix parent control geometry for QToolTipVlad Zahorodnii13 days1-7/+10
| | | | | | | | | | | | | | | | | | Amends 4eed22e67ed98ec2565be84a4838955af0faf8b0. The parent control geometry is specified relative to the parent window. However, currently, the QToolTip passes it in the global coordinate system. If you have only one output, it'll work as expected, but with multi-monitor setups, tooltips will be mispositioned. The `if (w)` guard was added to let QtWayland compute a better fallback geometry if no parent widget has been provided to QToolTip::showText(). Change-Id: Ia674c4d41fa00ad341a529268c0bc127e5e182a3 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Widget/Styles: fix naming of fusion_normalizedockup imagesChristian Ehrlicher13 days5-4/+4
| | | | | | | | | | The size must be separated by '-' instead '_'. Pick-to: 6.10 6.8 Fixes: QTBUG-142139 Change-Id: Ifaeebbf50c9aec80984b99301b0a3f17ae7c8df8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
* Doc: Update model/view diagrams to styled SVG versionsDavid Boddie2025-12-015-4/+518
| | | | | | | | | | | | Existing images are not suitable for use with the dark theme of the online documentation. SVG files are more versatile and can be styled for the light and dark themes. Some hard-coded properties are used to ensure that Assistant's SVG renderer can display the files in a reasonable way. Change-Id: Iafb72835937f1e96598993ee61de6f384e68b50b Reviewed-by: Jerome Pasion <jerome.pasion@qt.io>
* Doc: Fix QDoc warnings for internal classes in Qt WidgetsJerome Pasion2025-12-0122-8/+138
| | | | | | | | -Internal classes should have internal class documentation. Task-number: QTBUG-141665 Change-Id: I399e0cec51a9308172301a862dcd07e6137e9854 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Account for null QPointer in QWidgetAnimatorAxel Spoerl2025-11-251-2/+3
| | | | | | | | | | | | | | | | | | | | QWidgetAnimator has a QHash member m_animation_map with all active animations. Since it doesn't own the animations, they can get deleted while their pointers are still in the map. To avoid UAF, the QPropertyAnimation pointers are held in a QPointer. When a null QPointer was in the map, it caused a nullptr dereference and animating() returned true, even though nothing was animating. Add missing nullptr check. Don't count null QPointer as an ongoing animation. Amends 33214af3784feacb2d5188bbf07da92f45f582f9. Fixes: QTBUG-141761 Pick-to: 6.10 6.8 6.5 Change-Id: Iec081472ece2ec86b9ddcb7616ed65401be20cc4 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QTabBar: Emit tabCloseRequested on middle click if tabsClosableXavier BESSON2025-11-251-2/+12
| | | | | | | | | | [ChangeLog][QtWidgets] Middle clicking tabs in QTabBar with tabsClosable set to true will now emit tabCloseRequested. Fixes: QTBUG-141519 Change-Id: I101e599b95683e5de4e951f7da3ae31264caa24c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* QtWidgets: remove redundant Q_ENUMS usageAhmad Samir2025-11-252-2/+0
| | | | | | | | | | | Qt::WeekDays, Qt::ToolButtonStyle and Qt::ArrowType are already wrapped in Q_ENUM_NS, which supersedes the effect of Q_ENUMS. Q_ENUMS has been deprecated since at least Qt 6.0. Pick-to: 6.10 6.8 6.5 Change-Id: If89d772ee943127bbb0938d70edd465b2b736eab Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QBoxLayout: Fix QWidget::sizePolicy reference in docMichael Weghorn2025-11-241-2/+2
| | | | | | | | | | | | | | | | Use two colons instead of just a single one. Otherwise, the generated documention only lets the part before the colon reference the QWidget doc (see the QBoxLayout::insertWidget doc [1] generated without this commit in place) instead of detecting that this is a class method and referencing its documentation. [1] https://doc.qt.io/qt-6/qboxlayout.html#insertWidget Pick-to: 6.10 Change-Id: I6cd978aeae9d3078d2033d0efe70de3574444e2c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QListView: Correctly set State_Enabled flag in paintEventSebastian Beckmann2025-11-231-1/+1
| | | | | | | | | | This condition got flipped around in a cleanup. As a result, the enabled state would no longer be set. Amends d98fe19e3c502385052df8cdd27ad0eb038a05c6. Change-Id: I7be7242fcdb99cea9a3f940244a0bb84d6291e64 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Clarify the usage of file filters in QFileDialogAlexei Cazacov2025-11-214-57/+70
| | | | | | | | | | | | | This commit restructures and enhances the description of the file filters in QFileDialog. The commit adds info on MIME type filters and clarifies the case sensitivity of file filters on various platforms. Fixes: QTBUG-135381 Pick-to: 6.10 6.8 Change-Id: I1fa7eeefb0e242285ee3bc4a86f29b76f72abe8f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Alexei Cazacov <alexei.cazacov@qt.io>
* QTableView: correct selection with moved columns/rows and spansChristian Ehrlicher2025-11-201-19/+22
| | | | | | | | | | | | When a column or row is moved and there are spans, the calculation of the correct row was not correct for the 'moved to' column/row because there was a mixup of visual and logical columns. Pick-to: 6.10 6.8 Fixes: QTBUG-138513 Change-Id: Ia3d1aa2c5376cb25ea56dc55b6a57a88edbfec30 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Build with QT_NO_URL_CAST_FROM_STRINGAhmad Samir2025-11-203-3/+2
| | | | | | | | | | | Can't mark the whole repo with that macro, because in corelib that would take out the QString conversion operator which is BiC. Add a hard build-time error if QT_NO_URL_CAST_FROM_STRING is defined in corelib, as requested in code review. Change-Id: Ia0e302a2f82b86800e84d15e86ab138f78d45e4d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use Q_ENUM/Q_FLAG instead of Q_ENUMS/Q_FLAGSAhmad Samir2025-11-201-1/+2
| | | | | | | | | Q_ENUMS and Q_FLAGS have been deprecated since at least Qt 6.0. Task-number: QTBUG-99060 Change-Id: Ia8cbc607c34683dec99587571c0d04f1854e77c2 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTableView: misc optimization of setSelection()Christian Ehrlicher2025-11-191-4/+8
| | | | | | | | | | | QTableView::setSelection() is very often only called for one index (e.g. due to a mouse click) - therefor topLeft and bottomRight is the same. Avoid the calculation of the bottomRect index in such cases. Pick-to: 6.10 6.8 Task-number: QTBUG-138513 Change-Id: I2edba6943d554919d4873c1918e08b99d28112f3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QListView: misc cleanup for QListView::paintEvent()Christian Ehrlicher2025-11-191-22/+11
| | | | | | | Use range-based for-loop, use QFlags::setFlag() instead bit operators. Change-Id: I3391829427f7e64d6295ee007fd07813c09b1453 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QWidgets: deprecate QStyle::State_EditingChristian Ehrlicher2025-11-195-19/+5
| | | | | | | | | | | This enum was only used in QListView and even there it was not set (when an item was editor the editor had the focus, not the view so it could never be set). Fixes: QTBUG-69351 Fixes: QTBUG-68947 Change-Id: If8423bcc1595667ca6908820512024d9947abba0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QColorDialog: add out-of-bounds check for QWellArrayChristian Ehrlicher2025-11-191-1/+1
| | | | | | | | | | QWellArray which is used to display pre-defined colors did not check if the calculated row/column is inside the possible bounds. Pick-to: 6.10 6.8 Fixes: QTBUG-105476 Change-Id: Id795f825479540086b4126b633ef1889c420c714 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Widgets: Deprecate QStyleOptionMenuItem::MenuItemType::MarginChristian Ehrlicher2025-11-192-2/+5
| | | | | | | | | QStyleOptionMenuItem::MenuItemType::Margin is not used anywhere so deprecate this enum. Fixes: QTBUG-109669 Change-Id: I32c11a8166772d5b6c44cf8e897604f222713632 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QStyleSheetStyle: properly handle up/down stylesChristian Ehrlicher2025-11-171-6/+3
| | | | | | | | | | | Even when there is no rule for the complete QSpinBox, the handles could have a rule which should be honored. Pick-to: 6.10 6.8 Fixes: QTBUG-141916 Task-number: QTBUG-133845 Change-Id: I9411238b6d6aeaab51432b02bf66c97ca3b3b6af Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QMenu: Trigger on button releases without seeing pressed buttons beforeDavid Redondo2025-11-171-3/+6
| | | | | | | | | | | | | | | | | | | | On Wayland we can't make any assumptions about button state when we don't have pointer focus. Crucially when opening a popup (menu in this case), a pointer leave (focus out) event for the parent window and a pointer enter (focus in) event for the new menu window will be sent, and accordingly the platform backend resets the button state. However, this means QMenu might never see a move event with pressed buttons; and upon release, no action is triggered. If we see a release without having seen any pressed buttons: if the release happens over an action, activate it; otherwise do nothing, as before (it's just release of the press that opened the menu). Fixes: QTBUG-124920 Pick-to: 6.10 Change-Id: Id86e81431621ce577101bf7cf45252dd1a02bfc4 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* qcombobox_p.h: clean up includesMarc Mutz2025-11-152-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add: - <array> for the data member in QComboBoxPrivate, amending d8e110054876b1cbf186e95bac5561a237ee1c13 - <limit> for numerical_limits in ibid, amending f0443984b84dea782ccd06dbce59808d55b15dbe Replace with fwd decl, because the header uses in-name-only, add include to .cpp file, if not already present: - QLineEdit - QPainter - QStyleOption subclasses Remove, because after the recent moves of code from the header to the .cpp, these are no longer needed: - qapplication.h - qcompleter.h - qevent.h - qstandarditemmodel.h (moved to .cpp) In qcombobox.cpp, besides the additions implied by the changes to the _p.h, remove the qcombobox.h include and rely on the transitive include though the _p.h, thus checking the _p.h file includes for completeness. This reliance on transitive includes is ok, because they're all from the same component. Add includes in the recommended style (<>, QtModule/, grouped by module, groups ordered by generality, ascending, within groups alphabetically), staying away from the unordered pre-existing includes as much as possible. Just move the <array> includes into the right spot, amending 4a7c76d4a5365343178ea29c8a8e9b8d8acb89b5. Not picking back to not cause problems with users that rely on transitive includes, even though this is a private header. Change-Id: I3aa42daf15f51df02dda4d3ab5aad1c9fb4dfa84 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QComboBoxPrivateScroller: port timerEvent() to QTimerEvent::matches()Marc Mutz2025-11-151-1/+1
| | | | | | | | This API was added for 6.9; use it instead of comparing IDs manually. Pick-to: 6.10 Change-Id: I9f67295b10f32534c2888e0ffc357a2b824bc5fa Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* De-inline QComboBoxDelegateMarc Mutz2025-11-152-33/+61
| | | | | | | | | | | | | | | | Virtual functions should not be implemented inline. In particular, all virtual functions were implemented inline (incl. the dtor), so this class caused -Wweak-vtable, incl. all the negative effects that entails. As a drive-by, mark the contructor explicit, use Qt::StringLiterals, and cache the "separator" QString that we store in the model. Picking to all active branches to avoid conflicts going forward. Pick-to: 6.10 6.8 6.5 Change-Id: If3e2e9c6744844fa19047d4cadb35008172cde3d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* De-inline QComboBoxPrivateScrollerMarc Mutz2025-11-152-64/+102
| | | | | | | | | | | | | | | | | | | Virtual functions should not be implemented inline. In particular, all virtual functions were implemented inline (incl. the dtor), so this class caused -Wweak-vtable, incl. all the negative effects that entails. This also makes qcombobox_p.h compatible with QT_NO_KEYWORDS (the `emit`s were breaking it, even though the rest of the header dilligently used the Q_ variants of the keywords). As a drive-by, mark the contructor explicit and use chrono literals. Picking to all active branches to avoid conflicts going forward. Pick-to: 6.10 6.8 6.5 Change-Id: I6aa18328640a7cdcc809a8f77fc8c73ca839b93c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* a11y: Add a11y implementation for QColorWellMichael Weghorn2025-11-136-1/+272
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QColorWell widget is used to provide/present a set of predefined or custom colors in QColorDialog. So far, there was no accessibility implementation for this widget, meaning that the colors/items were completely inaccessible on the a11y layer. Introduce QAccessibleColorWell as new a11y implementation for QColorWell, and QAccessibleColorWellItem for all the color items it provides. As QColorWell arranges its items in columns (i.e. color indices 0 to QColorWell::numRows() - 1 are in first column, not 0 to QColorWell::numCols() -1 in the first row), also use the same order for the accessible children/child indices: Send a11y focus events when the focus moves between items in the QColorWell. This makes both, Orca on Linux and Narrator on Windows announce the currently focused item when navigating through the list using the keyboard. For now, use "RGB <red>, <green>, <blue>" for the accessible names of the color items (with <red>, <green and <blue> being the value for the color's RGB components), which is a form that the Orca screen reader could interpret in other contexts to speak the name of the closest known color, see [1], section "Speak colors as names". [1] https://help.gnome.org/users/orca/stable/preferences_speech.html.en Fixes: QTBUG-141571 Change-Id: I7ec64d87e6ae41070c5cb34341bbf527260cca3f Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io>
* De-inline QComboMenuDelegateMarc Mutz2025-11-132-13/+32
| | | | | | | | | | | | | | | | | | | | | | Virtual functions should not be implemented inline. In particular, polymorphic types ought to have an out-of-line dtor. In this case, not all virtual functions were implemented inline, so this class may not have suffered from -Wweak-vtable, and all the negative effects that entails, or at least not on all platforms. But move the implementation into the .cpp file, anyway, incl. the destructor, for consistency, and to reduce the number of includes in the _p.h file. As a drive-by, mark the contructor explicit, and the automatic QStyleOption* objects const. Picking to all active branches to avoid conflicts going forward. Pick-to: 6.10 6.8 6.5 Change-Id: I321cb482586766b323a64e3be17ccf1a4984eb64 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QComboxBox: replace className() comparison with qobject_castMarc Mutz2025-11-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The old code checked for a variable's dynamic type by calling its metaObject()->className(), comparing it to a dynamically-allocated QByteArray. Instead of fixing just the allocation, let's use a compile-time checked construct: Unlike inherits() and className(), qobject_cast ensures that the type we cast to actually exist and is in-scope. We recently noticed that we still have checks for classes that were removed for Qt 5.0, showing the danger of these stringly-typed interfaces. This is not a 100% equivalent construct, since the old code failed when the checked-for types were in the middle of the dynamic type hierarchy, while the qobject_cast will succeed. Arguably, the new code is "correcter" in this regard, but it doesn't matter, since neither of the two types checked are user-settable. Amends abbdb4d98d13e78cf47cca3c1d6a049770c57750. Pick-to: 6.10 6.8 6.5 Change-Id: I9828d23f887ac55d29dd83062ac64b8683fa295f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* De-inline QComboBoxListViewMarc Mutz2025-11-132-41/+55
| | | | | | | | | | | | | | | Virtual functions should not be implemented inline. In particular, all virtual functions were implemented inline (incl. the dtor), so this class caused -Wweak-vtable, incl. all the negative effects that entails. As a drive-by, mark the contructor explicit. Picking to all active branches to avoid conflicts going forward. Pick-to: 6.10 6.8 6.5 Change-Id: I53d87871d77b82442745f1b77383c209e5d7141d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QArrayDataOps::assign: improve for forward iterators (redux)Thiago Macieira2025-11-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | This differs from commit 37b37cddb67febd595cb06b54ac08f1e676ead4d in that it takes the prepend optimization into account in the new implementation, instead of leaving it up to the assign() caller. For the simple case of trivial types and identity projection, the fix was simple: just start copying from the beginning of the prepend optimization. For the non-identity projection or non-trivial types, there are now four possible regions (at most three of which can appear in any given condition) instead of three. And because there are two exit conditions for the prepend optimization and regular array, we must use iterators instead of a simple counter. This code is as exception-safe as the original: it isn't. If the copy constructors or copy assignment operators throw, the size of the container will not have been updated, so we'll either leak objects or access garbage ones when the container is destroyed. I don't care. Fixes: QTBUG-141366 Change-Id: Ibd7b16127e8a815b6725802029d082f1e39782b4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QGraphicsView: remove duplicate Q_FLAGS(QPainter::RenderHints)Ahmad Samir2025-11-131-1/+1
| | | | | | | | | | | QPainter already has the RenderHints markup since the start of the public history. Found while looking for Q_FLAGS to port to Q_FLAG. Change-Id: I8687f3aaf441c537d3e9f9db52c6e0f047b6e8b3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* qmenu: Adjust geometry passed to waylandDavid Edmundson2025-11-121-3/+5
| | | | | | | | | | | | The current code uses the qwidget->geometry() which is the position relative to it's parent widget. The QPA code needs the position relative to the toplevel window. Amends 4eed22e67ed98ec2565be84a4838955af0faf8b0 Fixes: QTBUG-141553 Change-Id: I5139d3b1afec00743bd8c8bb9af48001df2da97e Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
* a11y: Simplify implementation of QAccessibleTableIngo Klöcker2025-11-122-77/+8
| | | | | | | | | | | Since QAccessibleTable does now derive from QAccessibleWidgetV2 we can remove duplicate implementations of isValid(), role(), state(), and rect(). And adding the role argument to the constructor allows us to remove the guessing of the role. The factory already instantiates the correct (sub)class (of) QAccessibleTable. Change-Id: I6e0bb0ec4e8e706efa20df9458cd88abd991212a Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
* QStyleSheetStyle: don't call base implementation for PE_WidgetChristian Ehrlicher2025-11-111-1/+11
| | | | | | | | | | | | | Don't call the base implementation for PE_Widget for an QAbstractScrollArea when we have rules for it to avoid overriding of the style paintings by the base class. This was not visible until the windows11 style reimplemented the drawing for PE_Widget with 072bf40fe9597bdd910bb0c1e6a754c1a468b844. Pick-to: 6.10 6.8 Fixes: QTBUG-141819 Change-Id: I6e90dc6cb3b1a7151815d57d790c67317a97d589 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* wasm: a11y - Support checkbox with children aka 1/2 QGroupBoxEven Oscar Andersen2025-11-091-0/+2
| | | | | | | | | | | | | The structure we create is: <Group> <label> <checkbox> .. <rest of the children> Task-number: QTBUG-140108 Change-Id: I3a6604f17443010748e9631934c03317a37bb4b4 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wayland: Fix regression with custom popup completersIgor Khanin2025-11-081-3/+7
| | | | | | | | | | | | | | | | | Commit 4eed22e67ed98ec2565be84a4838955af0faf8b0 has broken the handling of popup-based QCompleter that use custom positioning, e.g. those attached to multi-line QTextEdit widgets - as in the "customcompleter" example. Following that change, popups now appear above or below the parent widget, which is usually far away from the cursor position or whatever other "hot" rectangle the application needs. Treating the completer popup the same as a combo dropdown is just not correct. There is probably something better to do to allow the compositor to place such popups correctly, but for now the best course of action is to not opt-in to the new Wayland mechanism to avoid breakage. Change-Id: I237d5f49b185c6a8593ef2dd72c9bcb6c6ff4785 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Styles: remove checks for classes no longer availableChristian Ehrlicher2025-11-082-5/+1
| | | | | | | | | | | | | | The classes - QDockSeparator - QDockWidgetSeparator - QPlastiqueStyle - QCleanlooksStyle are not available in Qt6 so no need to check for them. Pick-to: 6.10 6.8 Change-Id: I5dc41526a3bdd8bb1d9d041a903307f6af9bf84d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* a11y: Return correct string information for item viewsIngo Klöcker2025-11-072-8/+0
| | | | | | | | | | | | | | | | | This fixes the problem that accessible name was returned as string information for all types of accessible string information (except Description), i.e. Name, Help, Value, Accelerator, etc. This made some screen readers speak the accessible name multiple times when an item view got focus. After 9fa1b691c88a4b928d3c1814a15bcab0e329222e QAccessibleTable is a subclass of QAccessibleWidget(V2) which provides suitable default implementations. Remove the override of the text() getter. Fixes: QTBUG-141051 Change-Id: I443145b97d8546fc6c80689bae50cb896e29cfd1 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Widgets: Don't implicitly fall through non-trivial casesUlf Hermann2025-11-071-0/+4
| | | | | | | | | | | | | | Otherwise the compiler complains. In one case the fallthrough was intendend. In the others the case block was newly added and not intended to fall through to the next one. Amends commit 12313f3ebe00808e9b1c27ddcb49cedf3e09582b. Pick-to: 6.10 Change-Id: Ib0d4ce0ba6ae737df93cee1c8086210a21cb5bec Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* a11y: Make QSidebar keyboard-navigableMichael Weghorn2025-11-071-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QSidebar::selectUrl calls QItemSelectionModel::clear, which clears both, the selection and the current index. After that, it was only setting the selection, but no new current index, i.e. no entry was considered as having focus. As a result, navigating between entries using the keyboard didn't work, because the logic in QAbstractItemView::keyPressEvent/QListView::moveCursor didn't have a valid index to start from and therefore always set focus to the first entry. Fix this by also setting the current index again in QSidebar::selectUrl. Move emission of the QSidebar::goToUrl signal from QSidebar::clicked down into QSidebar::selectUrl to ensure this gets called when the URL/current index is set programatically by calling QSidebar::selectUrl directly instead of indirectly via QSidebar::clicked due to user action. (As an example, tst_QFileDialog2::task251321_sideBarHiddenEntries calls this directly, and the emulated mouse click now no longer triggers the QItemSelectionModel::currentChanged signal as the current index was already set by the previous call to QSidebar::selectUrl, and therefore the connected QSidebar::clicked slot is also no longer triggered.) Adjust the existing tst_qsidebar tests related to the QSidebar::goToUrl signal to the fact that this now gets emitted from QSidebar::selectUrl. (Since QSidebar isn't part of the public API, there's no need to keep the exact semantic of when the signal gets emitted unchanged.) Also switch the test to use PMF-style syntax to e.g. simplify finding those occurences using an IDE's "Find Usages" feature in the future. Fixes: QTBUG-141644 Change-Id: I872698de81912225cd42a5df3752d2693ac6b9ee Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>