We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Turns out its actually not a problem to put float values into the x1,y1,x2,y2 coordinate values of a qlineargradient liek:
x1,y1,x2,y2
s = 'background: qlineargradient(x2: 0.0, y2:2.0, stop:0 rgb(80,20,20), stop:1 rgb(75,175,75));' x.btn.setStyleSheet(s)
Unfortunately when compiling with qtsass the regular expression in conformers.py line 49 breaks on these. As soon as one replaces the floats with ints all is fine again.
Unfortunately again I have no clue how to make the re accept float values instead of the ints or anything else. It works with variables for instance.
qss_pattern = re.compile( r'qlineargradient\(' r'((?:(?:\s+)?(?:x1|y1|x2|y2):(?:\s+)?[0-9A-Za-z$_-]+,?)+)' # coords 🤷♂️🤷♂️🤷♂️ r'((?:(?:\s+)?stop:.*,?)+(?:\s+)?)?' # stops r'\)', re.MULTILINE, )
This is probably an easy one for someone who's into regular expressions?
The text was updated successfully, but these errors were encountered:
@ewerybody sure, I will fix it ;-),
Thanks for the help with the project!
Sorry, something went wrong.
Oh a co-worker was just helping me with the re 🙈 I almost had it myself. Sure one needs to escape the dot...
qss_pattern = re.compile( r'qlineargradient\(' r'((?:(?:\s+)?(?:x1|y1|x2|y2):(?:\s+)?[0-9A-Za-z$_\.-]+,?)+)' # coords r'((?:(?:\s+)?stop:.*,?)+(?:\s+)?)?' # stops r'\)', re.MULTILINE, )
Voilà! I'll put up a PR?
Fixing spyder-ide#42 float coords breaking gradient conformer
3bdeec6
Ooh I need the other one to finish first? Sorry. No rush!! 🙈
goanpeca
Successfully merging a pull request may close this issue.
Turns out its actually not a problem to put float values into the
x1,y1,x2,y2
coordinate values of a qlineargradient liek:Unfortunately when compiling with qtsass the regular expression in conformers.py line 49 breaks on these. As soon as one replaces the floats with ints all is fine again.
Unfortunately again I have no clue how to make the re accept float values instead of the ints or anything else. It works with variables for instance.
This is probably an easy one for someone who's into regular expressions?
The text was updated successfully, but these errors were encountered: