Skip to content

Implement SelectAll and Deselect in KoToolBase and derivatives.

This allows us to implement specialized select all and deselect functionality in the shape selection tool (default tool), shape edit tool (path tool), text tool and reference images tool.

This is largely because the text tool needed a 'select all', but I figured I could extend it to the other tools too. I'm somewhat unsure whether the reference tool really needs its own implementation as it inherits the default tool.

Test Plan

Text tool:

  • Edit a text.
  • Select all should select all characters in the text.
  • Deselect should deselect all characters, and the cursor shifts to the last selected position.

Shape Select/Default Tool:

  • Get an image with several vector objects on one layer.
  • Select all should select all shapes on the layer.
  • Deselect should deselect all shapes on the layer.

Shape Edit/Path Tool:

  • Select a path shape on a vector layer, switch to shape edit tool.
  • Select all should select all path nodes.
  • Deselect should deselect any selected nodes.

Reference Image tool:

  • Get an image with several reference images.
  • Select all should select all reference images.
  • Deselect should deselect any selected reference images.

Raster selection behaviour:

  • When on a paint layer with the freehand brush tool or any other non-vector tool.
  • Select all should make a pixel selection of the whole canvas.
  • Deselect should deselect any area selection.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

Reminder: the reviewer is responsible for merging the patch, this is to ensure at the least two people can build the patch. In case a patch breaks the build, both the author and the reviewer should be contacted to fix the build. If this is not possible, the commits shall be reverted, and a notification with the reasoning and any relevant logs shall be sent to the mailing list, kimageshop@kde.org.

Merge request reports