-
Notifications
You must be signed in to change notification settings - Fork 37
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 QElidingLineEdit
class for elidable QLineEdit
s
#154
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #154 +/- ##
==========================================
- Coverage 85.89% 85.38% -0.52%
==========================================
Files 32 35 +3
Lines 2644 2702 +58
==========================================
+ Hits 2271 2307 +36
- Misses 373 395 +22
☔ View full report in Codecov by Sentry. |
thank you @dalthviz! the behavior and tests look great. I'm a bit unhappy with the inheritance pattern at the moment, but I can see that it's nothing you've done wrong (more of an annoyance about the fact the "text-having" parts of QLabel and QLineEdit don't share any inheritance...) It's the fact that we need to have the same methods in the subclasses: # appears more or less the same in both subclasses
def setElideMode(self, mode: Qt.TextElideMode) -> None:
"""Set the elide mode to a Qt.TextElideMode."""
super().setElideMode(mode)
super().setText(self._elidedText()) i'd like to play with it briefly to see whether there's anything else I can think of. If not, I might just consider not using the same base class (don't worry about the pyside6 and napari tests at the moment either) |
Thank you @tlambert03 for giving this a check! I'm not totally convinced either about the inheritance pattern I did, so happy to get ideas to improve it or removing the base class if it is not worthy to have :) |
hey @dalthviz, very sorry about the delay here. Shall we just get this in? |
Hi @tlambert03 ! No problem! And I think the functionality provided works for what I wanted to achieve over napari indeed, so merging this could be nice 👍 Thank you for checking this again and for sure open to improve in a follow up PR the implementation details as needed! |
Example code:
Preview:
closes #152