pyapp-kit / superqt

Missing widgets and components for Qt-python
https://pyapp-kit.github.io/superqt/
BSD 3-Clause "New" or "Revised" License
215 stars 38 forks source link

Add QSearchableListWidget and QSearchableComboBox widgets #80

Closed Czaki closed 2 years ago

Czaki commented 2 years ago

This PR is port of PartSeg searchable widgets to supertqt requested by @kevinyamauchi on community meeting.

I know that documentation could be better and I would love to get some improvement suggestions.

codecov[bot] commented 2 years ago

Codecov Report

Merging #80 (4fd10de) into main (bd6fba9) will increase coverage by 0.32%. The diff coverage is 95.65%.

@@            Coverage Diff             @@
##             main      #80      +/-   ##
==========================================
+ Coverage   84.23%   84.55%   +0.32%     
==========================================
  Files          26       29       +3     
  Lines        2258     2325      +67     
==========================================
+ Hits         1902     1966      +64     
- Misses        356      359       +3     
Impacted Files Coverage Δ
src/superqt/combobox/_searchable_combo_box.py 93.33% <93.33%> (ø)
src/superqt/selection/_searchable_list_widget.py 96.96% <96.96%> (ø)
src/superqt/__init__.py 100.00% <100.00%> (ø)
src/superqt/combobox/__init__.py 100.00% <100.00%> (ø)
src/superqt/selection/__init__.py 100.00% <100.00%> (ø)

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 bd6fba9...4fd10de. Read the comment docs.

goanpeca commented 2 years ago

Thanks for this addition @Czaki!

Could you add some screenshots or an animation to your description so we get an initial glimpse of what the actual widgets do?

Czaki commented 2 years ago

Searchable list widget:

https://user-images.githubusercontent.com/3826210/164615525-477e9ac6-5e6b-4359-80d7-3211e0fedc72.mp4

combo box

https://user-images.githubusercontent.com/3826210/164618777-ab285e9e-27f2-4289-8d5c-748c79d8ed9e.mp4

Put this in documentation?

tlambert03 commented 2 years ago

thanks @Czaki, these are lovely.

Do you think we could do without the packaging module just for its parse function? I've never seen a QT_VERSION string that isn't just, X.Y.Z, so a simple comparison of tuple(int(i) for i in QT_VERSION.split(".")) < (5, 14, 0) should work (and we test quite a few backends/versions here so we'll see.

Czaki commented 2 years ago

I meet when playing with the dev release of PyQt5, but the first two positions should be enough. I add code without packaging. I think that the only exception could be ValueError, but I'm not sure.

But maybe the risk is not too high.

kevinyamauchi commented 2 years ago

Wow, super cool! Thanks, @Czaki !