Skip to content

Prevent flickering ActionGroup when switching parameter trees#2484

Merged
j9ac9k merged 1 commit intopyqtgraph:masterfrom
ntjess:fix-flickering-action
Oct 13, 2022
Merged

Prevent flickering ActionGroup when switching parameter trees#2484
j9ac9k merged 1 commit intopyqtgraph:masterfrom
ntjess:fix-flickering-action

Conversation

@ntjess
Copy link
Copy Markdown
Contributor

@ntjess ntjess commented Oct 11, 2022

Followup from 9b59e3e -- I didn't catch the issue for ActionGroup since it only happens when a tree is changed, i.e.:

def test():
    print("run")
params = interact(test)
tree.setParameters(params)
# set a breakpoint to catch the hovering button, then:
tree.setParameters(params)

I would add a test case for this, but I'm not sure how to programmatically check for an intermediately spawned top window.

self.button.clicked.connect(param.activate)

self.itemWidget.setLayout(layout := QtWidgets.QHBoxLayout())
layout.setContentsMargins(0, 0, 0, 0)

Check failure

Code scanning / CodeQL

Potentially uninitialized local variable

Local variable 'layout' may be used before it is initialized.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codeql cannot handle the walrus operator 😆

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Oct 13, 2022

This looks good to me @ntjess appreciate your work on fine-tuning this more!

@j9ac9k j9ac9k merged commit a919df5 into pyqtgraph:master Oct 13, 2022
@ntjess ntjess deleted the fix-flickering-action branch April 11, 2023 01:43
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