GraphicsLayout: Always call processEvents after adding items#1167
Closed
2xB wants to merge 1 commit intopyqtgraph:developfrom
Closed
GraphicsLayout: Always call processEvents after adding items#11672xB wants to merge 1 commit intopyqtgraph:developfrom
2xB wants to merge 1 commit intopyqtgraph:developfrom
Conversation
Items added to a GraphicsLayout need a call to 'processEvents' to receive their size information. Needing to call 'processEvents' is unintuitive, leading to multiple issues (see below). This commit fixes that by always calling 'processEvents' after adding items. Fixes pyqtgraph#8 Fixes pyqtgraph#1136
Member
|
oof...this might be a tough pill we have to swallow... going to ask @campagnola for input. |
Member
|
I agree with @j9ac9k -- adding |
2xB
added a commit
to 2xB/pyqtgraph
that referenced
this pull request
Apr 13, 2020
Items added to a `GraphicsLayout` only learn their size information after the internal `QGraphicsGridLayout` recalculates the layout. This is happening as a slot in the Qt event queue. Not having updated geometry bounds directly after adding an item leads to multiple issues when not executing the Qt event loop in time (see below). This commit fixes that by always calling `layout.activate()` after adding items, updating item sizes directly. This is a follow-up to PR pyqtgraph#1167, where introducing a direct call to `processEvents` was suspected to be able to cause side effects. Notifying @j9ac9k and @campagnola, as they were involved in pyqtgraph#1167. Fixes pyqtgraph#8 Fixes pyqtgraph#1136
2xB
added a commit
to 2xB/pyqtgraph
that referenced
this pull request
Apr 13, 2020
Items added to a `GraphicsLayout` only learn their size information after the internal `QGraphicsGridLayout` recalculates the layout. This is happening as a slot in the Qt event queue. Not having updated geometry bounds directly after adding an item leads to multiple issues when not executing the Qt event loop in time (see below). This commit fixes that by always calling `layout.activate()` after adding items, updating item sizes directly. This is a follow-up to PR pyqtgraph#1167, where introducing a direct call to `processEvents` was suspected to be able to cause side effects. Notifying @j9ac9k and @campagnola, as they were involved in pyqtgraph#1167. Fixes pyqtgraph#8 Fixes pyqtgraph#1136
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.
Items added to a
GraphicsLayoutneed a call toprocessEventsto receive their size information.Needing to call
processEventsis unintuitive, leading to multiple issues (see below).This commit fixes that by always calling
processEventsafter adding items.Fixes #8
Fixes #1136