Skip to content

Use property to lazily declare rectangle#2356

Merged
j9ac9k merged 4 commits intopyqtgraph:masterfrom
j9ac9k:lazy-rect-property
Jul 13, 2022
Merged

Use property to lazily declare rectangle#2356
j9ac9k merged 4 commits intopyqtgraph:masterfrom
j9ac9k:lazy-rect-property

Conversation

@j9ac9k
Copy link
Copy Markdown
Member

@j9ac9k j9ac9k commented Jul 9, 2022

Fixes #2352

This PR redoes #2168 in a way that we hope should make everyone happy. Thank you to @ksunden 's suggestion here for a good way of going about it.

@markotoplak @danielhrisca Please take the opportunity to test this branch and see if this works for your use-case.

Thanks!

@ksunden
Copy link
Copy Markdown
Contributor

ksunden commented Jul 9, 2022

depending on how it is used, you may add a setter

@j9ac9k
Copy link
Copy Markdown
Member Author

j9ac9k commented Jul 9, 2022

depending on how it is used, you may add a setter

Yeah I thought about that but wasn't sure what that should look like. We never supported setting your own QRectF instance, so I didn't think we should try supporting self.rbScaleBox =... but maybe we should...

@j9ac9k
Copy link
Copy Markdown
Member Author

j9ac9k commented Jul 9, 2022

Now a setter is supported; I'm thinking that in a future PR we will want to deprecate rbScaleBox attribute and instead use the standard Qt getter and setter methods; but that's for another time.

@j9ac9k j9ac9k force-pushed the lazy-rect-property branch from 45e6a31 to aa456d5 Compare July 11, 2022 15:10
@markotoplak
Copy link
Copy Markdown
Contributor

Thanks for this. It seems to work with our code base and looks like a good solution.

@j9ac9k
Copy link
Copy Markdown
Member Author

j9ac9k commented Jul 13, 2022

Thanks for checking @markotoplak !

@j9ac9k j9ac9k merged commit 255aa96 into pyqtgraph:master Jul 13, 2022
@j9ac9k j9ac9k deleted the lazy-rect-property branch July 13, 2022 17:03
j9ac9k added a commit to j9ac9k/pyqtgraph that referenced this pull request Aug 23, 2022
* Use property to lazily declare rectangle
j9ac9k added a commit to j9ac9k/pyqtgraph that referenced this pull request Aug 23, 2022
* Use property to lazily declare rectangle
j9ac9k added a commit to j9ac9k/pyqtgraph that referenced this pull request Aug 23, 2022
* Use property to lazily declare rectangle
j9ac9k added a commit to j9ac9k/pyqtgraph that referenced this pull request Aug 23, 2022
* Use property to lazily declare rectangle
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.

Lazy rectangle selection box contruction breaks subclassed ViewBoxes

4 participants