Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix AttributeError: 'QPixmap' object has no attribute 'setDevicePixelRatio'#8559

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tacaswell merged 1 commit intomatplotlib:v2.0.xfromcgohlke:patch-1
May 3, 2017

Conversation

cgohlke
Copy link
Contributor

Re#8440.
Using matplotlib-2.0.1 with PyQt4‑4.11.4, the exampleembedding_in_qt4_wtoolbar.py fails:

X:\Python36\lib\site-packages\matplotlib\backends\qt4_compat.py:10: MatplotlibDeprecationWarning: This module has been deprecated in 1.4 in favor of matplotlib.backends.qt_compatThis module will be removed in 1.5, please update your imports.  warnings.warn(_warn_str, mplDeprecation)Traceback (most recent call last):  File "embedding_in_qt4_wtoolbar.py", line 74, in <module>    main()  File "embedding_in_qt4_wtoolbar.py", line 69, in main    form = AppForm()  File "embedding_in_qt4_wtoolbar.py", line 27, in __init__    self.create_main_frame()  File "embedding_in_qt4_wtoolbar.py", line 39, in create_main_frame    self.mpl_toolbar = NavigationToolbar(self.canvas, self.main_frame)  File "X:\Python36\lib\site-packages\matplotlib\backends\backend_qt5.py", line 585, in __init__    NavigationToolbar2.__init__(self, canvas)  File "X:\Python36\lib\site-packages\matplotlib\backend_bases.py", line 2760, in __init__    self._init_toolbar()  File "X:\Python36\lib\site-packages\matplotlib\backends\backend_qt5.py", line 601, in _init_toolbar    a = self.addAction(self._icon(image_file + '.png'),  File "X:\Python36\lib\site-packages\matplotlib\backends\backend_qt5.py", line 591, in _icon    pm.setDevicePixelRatio(self.canvas._dpi_ratio)AttributeError: 'QPixmap' object has no attribute 'setDevicePixelRatio'

@WeatherGod
Copy link
Member

attn:@efiring

Copy link
Member

@efiringefiring left a comment

Choose a reason for hiding this comment

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

This looks right to me, and appears to be the only place where the conditional was missed.

@efiringefiring changed the titleFix AttributeError: 'QPixmap' object has no attribute 'setDevicePixelRatio'[MRG+1] Fix AttributeError: 'QPixmap' object has no attribute 'setDevicePixelRatio'May 2, 2017
@tacaswelltacaswell merged commitf92e79c intomatplotlib:v2.0.xMay 3, 2017
@QuLogicQuLogic added this to the2.0.2 (next bug fix release) milestoneMay 3, 2017
@QuLogicQuLogic changed the title[MRG+1] Fix AttributeError: 'QPixmap' object has no attribute 'setDevicePixelRatio'Fix AttributeError: 'QPixmap' object has no attribute 'setDevicePixelRatio'May 3, 2017
@tacaswelltacaswell modified the milestones:2.0.3 (next bug fix release),2.0.2 (critical bug fixes from 2.0.1)May 7, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@efiringefiringefiring approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
@cgohlke@WeatherGod@efiring@tacaswell@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp