Skip to content

fix setMaximumHeight(1e6) in SpinBox.py#2519

Merged
j9ac9k merged 1 commit intopyqtgraph:masterfrom
sem-geologist:patch-2
Nov 4, 2022
Merged

fix setMaximumHeight(1e6) in SpinBox.py#2519
j9ac9k merged 1 commit intopyqtgraph:masterfrom
sem-geologist:patch-2

Conversation

@sem-geologist
Copy link
Copy Markdown
Contributor

@sem-geologist sem-geologist commented Nov 4, 2022

After upgrading my KDE Neon and thus Qt to 5.15.6 I had found out that my software hiccups at pytqgraph SpinBox. I had tracked down problem to SpinBox.py, where method setMaximumHeight is fed with 1e6 which is float, and these are pixels (logically it should be integer numbers). Interestingly older Qt versions had not complained before and was consuming float without any complaining. Simple fix is to change this 1e6 to 1000000.

This fix is simple and straightforward.

in method of Qt 5.15.6 SpinBox  setMaximumHeight does not accept float.
changing 1e6 (which produces 1million in float) to integer 1000000
@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Nov 4, 2022

Hi @sem-geologist

Thanks for this fix; Python 3.10 removed a compatibility layer that I believe under the hood did a lot of the float-to-int conversions for us within the bindings. When Python 3.10 was coming out, we patched up a bunch of these, but clearly, a few instances slipped through the cracks.

It looks like we have a similar issue with AxisItem.py, although I haven't seen any issue like it.

Thanks for the PR @sem-geologist merging.

@j9ac9k j9ac9k merged commit 6cca1ba into pyqtgraph:master Nov 4, 2022
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.

2 participants