Skip to content

FIX: support Qt 5.15 #17565

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

Merged
merged 3 commits into from
Jun 6, 2020
Merged

FIX: support Qt 5.15 #17565

merged 3 commits into from
Jun 6, 2020

Conversation

tacaswell
Copy link
Member

PR Summary

  • QPainter.drawLine is now picky about float vs int
  • be more careful that we close the Qpainter out

I may need to check the exact version we need this for more carefully. May be a pyqt, not Qt change.

 - QPainter.drawLine is now picky about float vs int
 - be more careful that we close the Qpainter out
@tacaswell tacaswell added this to the v3.2.2 milestone Jun 4, 2020
No need for map when a single list comprehension will do.

Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
@QuLogic
Copy link
Member

QuLogic commented Jun 4, 2020

Strange, the .end() docs say you don't need to call it as it's done in the destructor, but many examples still seem to show it.

@@ -486,7 +486,7 @@ def drawRectangle(self, rect):
# Draw the zoom rectangle to the QPainter. _draw_rect_callback needs
# to be called at the end of paintEvent.
if rect is not None:
x0, y0, w, h = [pt / self._dpi_ratio for pt in rect]
x0, y0, w, h = [int(pt / self._dpi_ratio) for pt in rect]
Copy link
Member

Choose a reason for hiding this comment

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

Or round? c.f. #15656 (comment)

I'm not sure myself. I think I tested 15656 with round but it caused some test failures. Did not have time to investigate.

Maybe int() is good enough to fix this if we don't have the capacity to work out round vs. int.

Copy link
Member Author

Choose a reason for hiding this comment

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

We have looked at moving more things to round in other places (#8265) and it also caused failures. I am inclined to stay with int here as I suspect that is what is used to be doing under the hood (it is just complaining about in now).

On the other hand, this is in drawing the zoom box so it probably doesn't really matter?

Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

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

Modulo the int vs. round issue. But that's not a blocker.

@QuLogic QuLogic added the GUI: Qt label Jun 6, 2020
@QuLogic
Copy link
Member

QuLogic commented Jun 6, 2020

I may need to check the exact version we need this for more carefully. May be a pyqt, not Qt change.

Are you okay to merge now, or still wait?

@tacaswell
Copy link
Member Author

I'm OK to merge, the version checking would only be to mkae the comit message more accurate.

@QuLogic QuLogic merged commit 8d49327 into matplotlib:master Jun 6, 2020
@lumberbot-app
Copy link

lumberbot-app bot commented Jun 6, 2020

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
$ git checkout v3.2.x
$ git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
$ git cherry-pick -m1 8d49327d9d48c5a7ca3d3aa3071db5facac63b16
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
$ git commit -am 'Backport PR #17565: FIX: support Qt 5.15'
  1. Push to a named branch :
git push YOURFORK v3.2.x:auto-backport-of-pr-17565-on-v3.2.x
  1. Create a PR against branch v3.2.x, I would have named this PR:

"Backport PR #17565 on branch v3.2.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free to suggest an improvement.

@tacaswell tacaswell deleted the fix_new_qt branch June 8, 2020 21:53
tacaswell pushed a commit to tacaswell/matplotlib that referenced this pull request Jun 8, 2020
Merge pull request matplotlib#17565 from tacaswell/fix_new_qt

FIX: support Qt 5.15

Conflicts:
	lib/matplotlib/backends/backend_qt5.py
          - code was very different, int cast done differently.
QuLogic added a commit that referenced this pull request Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants