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

deprecate qt_viewer.screenshot & clipboard #3765

Merged
merged 4 commits into from Dec 9, 2021

Conversation

tlambert03
Copy link
Member

Description

Looking into changing the examples for #3066, at least some of the public usage is just to access clipboard and screenshot. Since those methods already exist on viewer.window, which is intended to be our public "gui related" api, this PR deprecates direct usage of viewer.window.qt_viewer.screenshot() in favor of viewer.window.screenshot(canavs_only=True) (matching the canvas_only kwarg already used in Viewer and nbscreenshot)

Type of change

  • Bug-fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

References

How has this been tested?

  • example: the test suite for my feature covers cases x, y, and z
  • example: all tests pass with my change

Final checklist:

  • My PR is the minimum possible work for the desired functionality
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • If I included new strings, I have used trans. to make them localizable.
    For more information see our translations guide.

@github-actions github-actions bot added the qt Relates to qt label Dec 7, 2021
Copy link
Contributor

@sofroniewn sofroniewn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. This now has conflicts (because i got trigger happy on #3066). I'll follow whatever you recommend for fixing @tlambert03 - if you want to revert my merge or if we just press on

@github-actions github-actions bot added the tests Something related to our tests label Dec 8, 2021
@codecov
Copy link

codecov bot commented Dec 8, 2021

Codecov Report

Merging #3765 (8247d2f) into main (d054fdb) will increase coverage by 0.05%.
The diff coverage is 86.39%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3765      +/-   ##
==========================================
+ Coverage   83.05%   83.10%   +0.05%     
==========================================
  Files         563      572       +9     
  Lines       46524    46972     +448     
==========================================
+ Hits        38642    39038     +396     
- Misses       7882     7934      +52     
Impacted Files Coverage Δ
napari/_qt/_tests/test_app.py 60.60% <ø> (-2.26%) ⬇️
napari/_qt/layer_controls/qt_points_controls.py 89.26% <0.00%> (-1.22%) ⬇️
napari/_qt/layer_controls/qt_shapes_controls.py 91.94% <0.00%> (-1.26%) ⬇️
napari/_qt/menus/debug_menu.py 71.42% <0.00%> (ø)
napari/_qt/menus/help_menu.py 100.00% <ø> (ø)
napari/_tests/test_adding_removing.py 100.00% <ø> (ø)
napari/_tests/test_draw.py 36.84% <0.00%> (ø)
napari/_tests/test_examples.py 80.00% <ø> (-0.96%) ⬇️
...ispy/experimental/_tests/test_vispy_tiled_image.py 27.27% <0.00%> (ø)
napari/benchmarks/benchmark_qt_viewer_image.py 0.00% <0.00%> (ø)
... and 124 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e6ce01d...8247d2f. Read the comment docs.

@sofroniewn sofroniewn merged commit bf8682e into napari:main Dec 9, 2021
kevinyamauchi pushed a commit to kevinyamauchi/napari that referenced this pull request Dec 17, 2021
* deprecate qt_viewer.screenshot & clipboard

* not private yet

* fix tests
Carreau pushed a commit that referenced this pull request Oct 26, 2023
Closes #6364

I've updated the example script to no longer access the clipboard via
`viewer.window.qt_viewer.clipboard` (which we plan to deprecate).
Instead we now use `viewer.window.clipboard` directly (which is part of
the external API).

Related:
* #3765
* #6283
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
qt Relates to qt tests Something related to our tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants