Skip to content
New issue

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

PR: Change setResizeMode to setSectionResizeMode #3944

Merged
merged 2 commits into from
Jan 10, 2017

Conversation

rlaverde
Copy link
Member

Fixes #3943


There is also another call to this method in https://github.com/spyder-ide/spyder/blob/master/spyder/widgets/variableexplorer/dataframeeditor.py#L432 but I tested and doesn't throw that error

@ccordoba12 ccordoba12 added this to the v3.1 milestone Jan 10, 2017
@ccordoba12
Copy link
Member

Thanks a lot for the quick response @rlaverde!

@@ -67,7 +67,7 @@ def toggle_hscrollbar(self, checked):
if PYQT5:
self.header().setSectionResizeMode(QHeaderView.ResizeToContents)
else:
self.header().setResizeMode(QHeaderView.ResizeToContents)
Copy link
Member

Choose a reason for hiding this comment

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

We need a try/except here to support older qtpy versions. We could rewrite this if block as

try:
    self.header().setSectionResizeMode(QHeaderView.ResizeToContents)
except:
    self.header().setResizeMode(QHeaderView.ResizeToContents)

and remove the PYQT5 constant

Copy link
Member

Choose a reason for hiding this comment

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

Me like 👍

@ccordoba12
Copy link
Member

Please also change the other setResizeMode call even if it doesn't throw errors.

@ccordoba12
Copy link
Member

LGTM, thanks :-)

@ccordoba12 ccordoba12 changed the title Change setResizeMode to setSectionResizeMode PR: Change setResizeMode to setSectionResizeMode Jan 10, 2017
@ccordoba12 ccordoba12 merged commit 97b5b5a into spyder-ide:3.x Jan 10, 2017
ccordoba12 added a commit that referenced this pull request Jan 10, 2017
@rlaverde rlaverde deleted the error-qtpy branch January 10, 2017 19:52
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.

3 participants