Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a QStyledItemDelegate to handle name updates to our layers. #14

Closed

Conversation

willGraham01
Copy link
Contributor

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?

Double-clicking a layer (technically a NodeWrappingLayer) in our GroupLayer display allows the user to input some text to change the name of the layer, but this change then does not take effect.

What does this PR do?

Adds the required custom QStyledItemDelegate subclass, QtGroupLayerItemDelegate, to handle the editing step. It is identical to the abstract class, save for how it updates the model data after receiving information from the QLineEditor editor.

References

This should hopefully address the NodeWrappingLayers aspect of #5.
It should also hopefully not result in too many conflicts with the other part of that issue. In fact, it we might even be able to combine the logic of both into the same setModelData method.

How has this PR been tested?

Is this a breaking change?

Does this PR require an update to the documentation?

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality (unit & integration)
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

@willGraham01 willGraham01 changed the base branch from main to ARC-dev-branch June 19, 2024 13:17
@willGraham01 willGraham01 force-pushed the wgraham/allow-double-click-rename branch from 0c003db to 5566b36 Compare June 19, 2024 13:27
Copy link

codecov bot commented Jun 19, 2024

Codecov Report

Attention: Patch coverage is 72.72727% with 3 lines in your changes missing coverage. Please review.

Project coverage is 58.78%. Comparing base (ea7a343) to head (5566b36).

Files Patch % Lines
src/napari_experimental/group_layer_qt.py 72.72% 3 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##           ARC-dev-branch      #14      +/-   ##
==================================================
+ Coverage           57.97%   58.78%   +0.81%     
==================================================
  Files                   5        5              
  Lines                 138      148      +10     
==================================================
+ Hits                   80       87       +7     
- Misses                 58       61       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@willGraham01 willGraham01 marked this pull request as draft June 19, 2024 14:33
@willGraham01
Copy link
Contributor Author

Closing in favour of (now merged) #19

@willGraham01 willGraham01 deleted the wgraham/allow-double-click-rename branch June 21, 2024 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant