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

Add tracking property to sliders. When False, changed only emits on release. #248

Merged
merged 2 commits into from
Jul 10, 2021

Conversation

tlambert03
Copy link
Member

closes #https://github.com/napari/magicgui/issues/234

This adds a 'tracking' property to sliders, following the naming set by Qt:

tracking : bool

This property holds whether slider tracking is enabled


If tracking is enabled (the default), the slider emits the valueChanged() signal while the slider is being dragged. If tracking is disabled, the slider emits the valueChanged() signal only when the user releases the slider.

from magicgui import magicgui


@magicgui(auto_call=True, input={"widget_type": "Slider", "tracking": False})
def slider(input=1):
    ...

@codecov
Copy link

codecov bot commented Jul 10, 2021

Codecov Report

Merging #248 (ef87de0) into master (8dfe2e7) will increase coverage by 0.01%.
The diff coverage is 92.30%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #248      +/-   ##
==========================================
+ Coverage   90.69%   90.70%   +0.01%     
==========================================
  Files          28       28              
  Lines        3075     3100      +25     
==========================================
+ Hits         2789     2812      +23     
- Misses        286      288       +2     
Impacted Files Coverage Δ
magicgui/backends/_qtpy/widgets.py 87.80% <85.71%> (-0.03%) ⬇️
magicgui/widgets/_concrete.py 84.17% <88.88%> (+0.13%) ⬆️
magicgui/widgets/_bases/slider_widget.py 89.28% <100.00%> (+3.57%) ⬆️
magicgui/widgets/_protocols.py 99.45% <100.00%> (+<0.01%) ⬆️

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 8dfe2e7...ef87de0. Read the comment docs.

@tlambert03 tlambert03 merged commit 56f9343 into pyapp-kit:master Jul 10, 2021
@tlambert03 tlambert03 deleted the slider-tracking branch July 10, 2021 20:38
@tlambert03 tlambert03 added the enhancement New feature or request label Jul 11, 2021
@queenmatalie
Copy link

can i used used example ( the clock deblur example using napari & magicgui:) with real time.

@tlambert03
Copy link
Member Author

I'm sorry, I'm not following... clarify?

@queenmatalie
Copy link

code clock deblur example using napari & magicgui:
can not run this code

AttributeError: No napari attribute types

@tlambert03
Copy link
Member Author

Hi @queenmatalie, I'm sorry, I don't understand. If you'd like help running the example, you'll need to provide more information. What version of napari and magicgui are you running, exactly what code are you running, etc...

@queenmatalie
Copy link

queenmatalie commented Jul 31, 2021

Python 3.8.8 on windows 10 used this code on jupyter notebook
when command version napari on anaconda this result below:
'napari--version' is not recognized as an internal or external command,
operable program or batch file.

but another code is running and open window napari

@tlambert03
Copy link
Member Author

you can't run the command napari in a jupyter notebook. it's a command line command. please have a look through the napari tutorials for an introduction to napari
https://napari.org/tutorials/fundamentals/index.html

@queenmatalie
Copy link

thank you , very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants