Merged
Conversation
Member
|
Thanks @NilsNemitz I'm glad you mentioned the other PR as I was reading this, I kept thinking that we saw this being an issue elsewhere. PR LGTM, merging! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current handling of
tickPeninAxisItemdoesn't work for QPens that have more complex brush settings, such as gradients: When the opacity is adjusted for different tick levels (major, minor and extra ticks), resetting the color causes the applied brush settings to be lost.As a work-around, we can skip the opacity adjustment for any QPen that has a more complex brush setting than
Qt.SolidPattern. This lets the ticks be drawn according to the original pen's brush settings, although without the opacity adjustments. This opens up some new drawing options.While modifying the code, we can also move reconstructing the QPen outside the inner per-tick loop, because it only needs to be done once for major ticks, minor ticks, and extra ticks (if present).
We can also make sure that we are working with copies of QPens and QColors; The current code created problems in earlier PR #1625 by modifying the opacity of the original color.
Here's some code to look at the change:
Current code:

Revised code:

I'll admit that the use case for this is severly limited. :)