Skip to content

ToggleActionMenu 2000

Result of the meeting, which I summarized in !254 (comment 194076):

Meeting results:

  • Don’t need to reimplement removeAction(), because of QEvent::ActionRemoved.
  • Don’t need initialization logic, because in our use cases we are able to initialize manually & well enough.
  • Don’t need ‘QuickSelectAction’, it will (now) fit perfectly in only one class.

This patch is based on !254 (closed), but is fundamentally different. Changes to master:

  • ToggleActionMenu uses more QPointer.
  • ToggleActionMenu doesn’t take behavior parameters in the constructor.
    • Remove all intelligence from ToggleActionMenu.
      • No initialization logic for the default action.
      • No automatic updating of the default action when an action is triggered.
    • Instead, require the default action to be in the menu, and reset it automatically when it is removed from the menu.
      • This is implemented with eventFilter() on the menu(), which listens to QEvent::ActionRemoved.
  • Autotest for ToggleActionMenu.

Makes !254 (closed) obsolete.

TODO

  • This patch depends on !385 (merged) and !384 (merged), which update the ToggleActionMenu usages in AnnotationActionHandler and PageView. Afterwards, this MR can be rebased on master and merged to master.

@gaiarin, @aacid

Edited by Laura David Hurka

Merge request reports

Loading