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

fix: add deprecated QStyleOption names in the Qt5 interfaces #323

Merged
merged 1 commit into from
May 19, 2018

Conversation

grlee77
Copy link
Contributor

@grlee77 grlee77 commented May 18, 2018

This PR resolves a crash in Mayavi when using pyface 6.0 and PyQt 5.6.

The crash can be reproduced by trying to drag the Tab labeled "Mayavi Scene 1" in the screen shot below:
mayavi_screenshot

Trying to drag the tab crashes the application with the following traceback.

Traceback (most recent call last):
  File "/Users/lee8rx/anaconda/lib/python3.5/site-packages/pyface/ui/qt4/workbench/split_tab_widget.py", line 897, in mouseDoubleClickEvent
    self._resize_title_edit_to_current_tab()
  File "/Users/lee8rx/anaconda/lib/python3.5/site-packages/pyface/ui/qt4/workbench/split_tab_widget.py", line 985, in _resize_title_edit_to_current_tab
    tab = QtGui.QStyleOptionTabV3()
AttributeError: module 'pyface.qt.QtGui' has no attribute 'QStyleOptionTabV3'

The names QStyleOptionTabV3, QStyleOptionTabV2 and QStyleOptionTabBarBaseV2 have been deprecated and do not exist in the PyQt5 or PySide2 namespaces. This PR adds them to the pyface.qt.QtGui namespace. Relevant Qt documentation:
https://doc.qt.io/qt-5.10/qstyleoptiontab-obsolete.html
https://doc.qt.io/qt-5/qstyleoptiontabbarbase-obsolete.html

@codecov-io
Copy link

codecov-io commented May 18, 2018

Codecov Report

Merging #323 into master will increase coverage by 0.02%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #323      +/-   ##
==========================================
+ Coverage   24.63%   24.65%   +0.02%     
==========================================
  Files         455      455              
  Lines       25541    25547       +6     
  Branches     3851     3851              
==========================================
+ Hits         6291     6298       +7     
- Misses      18936    18937       +1     
+ Partials      314      312       -2
Impacted Files Coverage Δ
pyface/qt/QtGui.py 52.38% <50%> (-0.96%) ⬇️
pyface/ui/qt4/util/modal_dialog_tester.py 89.47% <0%> (+3%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 04c15dc...4494953. Read the comment docs.

@corranwebster
Copy link
Contributor

Thanks!

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.

None yet

3 participants