Skip to content

fix: Fix the colormap creation for Qt6 - #1449

Open
Czaki wants to merge 2 commits into
developfrom
fix_colormap_creation
Open

fix: Fix the colormap creation for Qt6#1449
Czaki wants to merge 2 commits into
developfrom
fix_colormap_creation

Conversation

@Czaki

@Czaki Czaki commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Summary by Sourcery

Bug Fixes:

  • Fix get_mouse_y helper to return the event's Y position instead of the X position when using Qt6.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected vertical mouse-position reporting for Qt5 events.

@sourcery-ai

sourcery-ai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Corrects the Qt6 mouse event helper to return the Y coordinate from position().y() instead of incorrectly using position().x().

Flow diagram for updated Qt6 mouse Y coordinate helper

flowchart LR
    QMouseEvent_event["QMouseEvent event"]
    get_mouse_y["get_mouse_y(event)"]
    position["position()"]
    y["y()"]
    return_y["return Y coordinate"]

    QMouseEvent_event --> get_mouse_y
    get_mouse_y --> position
    position --> y
    y --> return_y
Loading

File-Level Changes

Change Details Files
Fix mouse Y-coordinate helper to use the correct Qt6 API.
  • Update get_mouse_y to return event.position().y() instead of event.position().x()
  • Keep get_mouse_x implementation unchanged and aligned with Qt6 QMouseEvent API
package/PartSeg/common_gui/qt_util.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Czaki, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 22 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: db76d8b8-001e-4311-ad34-bf2f848ada7c

📥 Commits

Reviewing files that changed from the base of the PR and between d18d6eb and f734079.

📒 Files selected for processing (2)
  • package/PartSeg/common_gui/__init__.py
  • package/tests/test_PartSeg/test_common_gui.py

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: aca99d81-6f57-4611-8892-8d74b1f29720

📥 Commits

Reviewing files that changed from the base of the PR and between 6674b83 and d18d6eb.

📒 Files selected for processing (1)
  • package/PartSeg/common_gui/qt_util.py

📝 Walkthrough

Walkthrough

The get_mouse_y implementation now returns the mouse event’s vertical coordinate instead of its horizontal coordinate.

Changes

Mouse coordinate fix

Layer / File(s) Summary
Read the event Y coordinate
package/PartSeg/common_gui/qt_util.py
get_mouse_y now uses event.position().y() instead of event.position().x().

Estimated code review effort: 1 (Trivial) | ~2 minutes

Mergeability Score: ⚪ Minimal · up to d18d6

This is a small localized change, and no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title describes a Qt6 colormap fix, but the changes correct the Qt5-compatible get_mouse_y implementation. Replace the title with a concise description of the get_mouse_y correction, such as "fix: Return mouse event y-coordinate in get_mouse_y".
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix_colormap_creation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.58%. Comparing base (6674b83) to head (f734079).

Files with missing lines Patch % Lines
package/PartSeg/common_gui/qt_util.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1449   +/-   ##
========================================
  Coverage    92.58%   92.58%           
========================================
  Files          211      211           
  Lines        33230    33236    +6     
========================================
+ Hits         30765    30771    +6     
  Misses        2465     2465           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant