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
backend_qt5 (1.4.0): Not saving the figure with NavigationToolbar (solved) #3454
Comments
@mfitzp can you take a look at this? (Let me know if I should stop pestering you with these issues). |
Also, I realized that some classes (at least one) have changed between QtCore and QtGui (QtWidgets mainly in pyqt5) in the 4->5 transition. For instance, |
@tacaswell I'm happy to have a look, I have a drop-in wrapper for getSaveFileName that should fix this bug. Happy to keep looking at these issues, but I am currently writing up a PhD and moving to the Netherlands (11 days!) so may be a bit of lag. @getzze The qt_compat only aims to shim the things that are actually used in the Qt backend. It would be nice to have a complete API compatibility layer - not least because of duplications of effort applying similar compatibility layers in other projects - but it's a big task. If you're interested we could have a go? |
@mfitzp Good luck! |
The opened PR #3469 should fix this. It updates all APIs to present a PyQt5/PySide like interface returning a tuple and then handles this in the backend. |
Bug also reported here: https://bugs.archlinux.org/task/41790
When clicking on the Save button on the NavigationToolbar, I get an error:
Format "png)')" is not supported. Supported formats: eps, jpeg, jpg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff.
I tracked the bug to be coming from the output of the
_getSaveFileName
function, that is supposed to be a string but is a tuple in reality. Inqt_compat.py
,_getSaveFileName
links to QtWidgets.QtFileDialog.getSaveFileName.In pyqt4, this function returns a string, but the doc pyqt4/5 differences says that in pyqt5 the functions returns a tuple (filename, extension), as for
getSaveFileNameAndFilter
in pyqt4.Commenting line 96 in
qt_compat.py
solved the problem, because_getSaveFileName
is then correctly defined in line 117 (only returning the first element of the tuple).The text was updated successfully, but these errors were encountered: