Project

General

Profile

Actions

Bug #13464

closed
MV RM

Moving of WMenuItem

Bug #13464: Moving of WMenuItem

Added by Matthias Van Ceulebroeck over 1 year ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
01/29/2025
Due date:
% Done:

100%

Estimated time:

Description

There currently exist no direct way to move around WMenuItems in a WMenu. Although this IS supported by first removing them, and adding them again, calling WMenu::removeItem() and WMenu::insertItem() respectively.

Now, this will result in a segfault, when the contents of the item are loaded Lazy. This is because the wrapping container (uContentsContainer) is removed, and the content that was added to the WStackedWidget to display it, it taken back by the WMenuItem (WMenuItem::returnContentsInStack()). To avoid this issue, we need to check the assumption that the uContentsContainer exists, when we try to add it to the WStackedWidget.


Additionally, since we already offer removeItem and insertItem, we can cut out the middle-man, and provide WMenu::moveItem(int fromIndex, int toIndex), and WMenu::moveItem(WMenuItem* item, int toIndex).
Any existing WMenuItem at toIndex or beyond, will have their index increased by one.

RM Updated by Romain Mardulyn over 1 year ago Actions #1

  • Status changed from New to InProgress
  • Assignee set to Romain Mardulyn

RM Updated by Romain Mardulyn over 1 year ago Actions #2

  • Status changed from InProgress to Review
  • Assignee deleted (Romain Mardulyn)

MV Updated by Matthias Van Ceulebroeck about 1 year ago Actions #3

  • Assignee set to Matthias Van Ceulebroeck

MV Updated by Matthias Van Ceulebroeck about 1 year ago Actions #4

  • Status changed from Review to Implemented @Emweb
  • Assignee changed from Matthias Van Ceulebroeck to Romain Mardulyn
  • % Done changed from 0 to 100

MV Updated by Matthias Van Ceulebroeck about 1 year ago Actions #5

  • Status changed from Implemented @Emweb to Implemented @Test

MV Updated by Matthias Van Ceulebroeck 11 months ago Actions #6

  • Status changed from Implemented @Test to Closed
Actions

Also available in: PDF Atom