Improvements #11868
closedDefine a signal for when the content of `WStackedWidget` changes
100%
Description
A WStackedWidget
can be used to define a stack of widgets. A widget can then be selected as the "active" one (using setCurrentIndex() or setCurrentWidget()).
The item/index that is then selected will be explicitly called, ensuring that the developer is fully aware of the content changing.
However, a WMenu
uses a WStackedWidget
to display its content. One can listen to the itemSelected() signal to retrieve that item that was selected. However, it is possible that in a structure with nested menus, the current selected menu item doesn't change, but the displayed widget in the stack does change. For example, if there is a tree of menus of depth 2.
- Item 1 (Menu)
- SubItem 1 (*)
- SubItem 2
- Item 2 (Menu)
- SubItem 3 (*)
- SubItem 4
Say we have visited SubItem 1, and SubItem 3 already. Currently we are looking at SubItem 1. If we switch to SubItem 3 again, the contents of the stack change. However, the itemSelected()
of the main menu is called, but not that of the submenu (Item 2 itself).
This may require custom logic from developers to find the current selected item. As such, a signal can be added to WStackedWidget
(something like currentWidgetChanged()
) to ensure that this change can be noticed.
Updated by Matthias Van Ceulebroeck 5 months ago
- Assignee set to Romain Mardulyn
- Target version changed from 4.11.0 to 4.11.1
Updated by Romain Mardulyn 4 months ago
- Status changed from InProgress to Review
Updated by Matthias Van Ceulebroeck 3 months ago
- Assignee set to Matthias Van Ceulebroeck
Updated by Matthias Van Ceulebroeck about 2 months ago
- Status changed from Review to Implemented @Emweb
- Assignee changed from Matthias Van Ceulebroeck to Romain Mardulyn
- % Done changed from 0 to 100
Updated by Matthias Van Ceulebroeck about 1 month ago
- Status changed from Implemented @Emweb to Implemented @Test
Updated by Matthias Van Ceulebroeck about 1 month ago
- Status changed from Implemented @Test to Closed