Skip to content

fix(ring): add hover_progress Qt property validation for QPropertyAnimation target#1101

Closed
Copilot wants to merge 5 commits intofeat/ring-progress-enhancedfrom
copilot/sub-pr-1031
Closed

fix(ring): add hover_progress Qt property validation for QPropertyAnimation target#1101
Copilot wants to merge 5 commits intofeat/ring-progress-enhancedfrom
copilot/sub-pr-1031

Conversation

Copy link
Contributor

Copilot AI commented Mar 17, 2026

QPropertyAnimation(self, b"hover_progress") silently does nothing if the target Qt property is absent or misnamed — no exception, no log, no visual feedback. This PR adds an explicit guard and documents the dependency.

Description

  • Added a # NOTE: comment above the QPropertyAnimation constructor documenting that b"hover_progress" must match the @SafeProperty(float) named hover_progress defined on the class.
  • Added a metaObject().indexOfProperty("hover_progress") == -1 check immediately after construction that emits a logger.warning if the property isn't registered in Qt's meta-object system.
  • Fixed a pre-existing bug in the same block: the easing curve else branch incorrectly used QtCore.QEasingCurve.Type.OutCubic (would raise AttributeError on older Qt without .Type), corrected to QtCore.QEasingCurve.OutCubic.
# NOTE: b"hover_progress" must match the @SafeProperty(float) named 'hover_progress'
# defined on this class. QPropertyAnimation silently fails if the target property is
# absent or misnamed, so we verify registration immediately after construction.
self._hover_animation = QtCore.QPropertyAnimation(self, b"hover_progress", parent=self)
if self.metaObject().indexOfProperty("hover_progress") == -1:  # pragma: no cover
    logger.warning(
        "Ring: 'hover_progress' is not registered as a Qt property; "
        "the hover animation will not work. Ensure the 'hover_progress' "
        "SafeProperty is defined on this class."
    )

Related Issues

Type of Change

  • Bug fix (easing curve fallback for Qt5 compatibility)
  • Defensive runtime check for animation property registration

How to test

  • Run unit tests
  • Open Ring/RingProgressBar in designer and verify hover animation still works as expected

Potential side effects

None. The check is read-only and the warning path is marked # pragma: no cover (only reachable if the property is removed).

Screenshots / GIFs (if applicable)

Additional Comments

Original PR: #1031. Addresses review feedback on the hover_progress animation target dependency.

Definition of Done

  • Documentation is up-to-date.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

wyzula-jan and others added 2 commits March 17, 2026 14:08
Copy link
Contributor Author

Copilot AI commented Mar 17, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Copilot AI changed the title [WIP] [WIP] Address feedback on hover mouse effect for ring_progress_bar fix(ring): add hover_progress Qt property validation for QPropertyAnimation target Mar 17, 2026
Copilot AI requested a review from wyzula-jan March 17, 2026 13:17
@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@wyzula-jan wyzula-jan closed this Mar 17, 2026
@wyzula-jan wyzula-jan deleted the copilot/sub-pr-1031 branch March 17, 2026 13:25
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.

2 participants