Skip to content
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

Get the Qt Quartz backend working again #679

Merged
merged 1 commit into from
Mar 4, 2021
Merged

Get the Qt Quartz backend working again #679

merged 1 commit into from
Mar 4, 2021

Conversation

jwiggins
Copy link
Member

@jwiggins jwiggins commented Mar 4, 2021

Closes #516

This PR switches the Qt Quartz backend from a Window-based GC to an offscreen GC, because the changes in Qt5 make it very difficult (or impossible?) to reuse the CGContextRef from Qt's widget.


from kiva.api import Font
from kiva.quartz import get_mac_context, ABCGI
from kiva.quartz import ABCGI
Copy link
Member Author

Choose a reason for hiding this comment

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

Now that get_mac_context is not needed, we should revisit whether to include it.

Copy link
Contributor

@aaronayres35 aaronayres35 left a comment

Choose a reason for hiding this comment

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

Changes LGTM

I ran ETS_TOOLKIT=qt4.quartz python kiva_explorer.py and things seemed to all be working / look fine.

One question: I noticed in many other files in enable/qt4 in the create_gc method there is a gc.translate_ctm(0.5, 0.5)
Is this because of the ideas on this slide of the LnL:
Screen Shot 2021-03-04 at 12 10 51 PM

@jwiggins
Copy link
Member Author

jwiggins commented Mar 4, 2021

I believe there is no half pixel translation because Quartz whole coordinates are already through the center of pixels instead of along the edge.

@jwiggins jwiggins merged commit eb17d1b into master Mar 4, 2021
@jwiggins jwiggins deleted the fix/qt-quartz branch March 4, 2021 20:19
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.

PyQt5 Quartz backend fails
2 participants