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

GWHAT crash when trying to save the monthly weather average graph to disk. #102

Closed
jnsebgosselin opened this issue Nov 29, 2017 · 2 comments

Comments

@jnsebgosselin
Copy link
Owner

What steps will reproduce the problem?

  1. Open GWHAT and go to the Plot Hydrograph tab.
  2. Open the Weather Averages window
  3. Try to save the graph
Traceback (most recent call last):
  File "C:\Users\jsgosselin\GWHAT\gwhat\meteo\weather_viewer.py", line 239, in s
ave_graph
    dialog.setConfirmOverwrite(True)
AttributeError: 'QFileDialog' object has no attribute 'setConfirmOverwrite'

image

@jnsebgosselin
Copy link
Owner Author

This bug is cause by a change that was introduced in the Qt API between qt4 and qt5. Since by default QFileDialog ask for confirmation before overriding, I think that all the setConfirmOverwrite can be removed from the code.

http://doc.qt.io/qt-5/qfiledialog-obsolete.html
https://doc.qt.io/qt-5/qfiledialog.html

@jnsebgosselin
Copy link
Owner Author

jnsebgosselin commented Nov 29, 2017

Fixing the above error, GWHAT is still crashing. The way getSaveFileName is called must also be changed to respect the qt5 API.

Traceback (most recent call last):
  File "C:\Users\jsgosselin\GWHAT\gwhat\meteo\weather_viewer.py", line 240, in s
ave_graph
    caption='Save graph', dir=ddir, filter='*.pdf;;*.svg')
TypeError: getSaveFileName(parent: QWidget = None, caption: str = '', directory:
 str = '', filter: str = '', initialFilter: str = '', options: Union[QFileDialog
.Options, QFileDialog.Option] = 0): 'dir' is not a valid keyword argument

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant