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

Bad workaround for #659 #663

Merged
merged 1 commit into from
Jan 11, 2024
Merged

Bad workaround for #659 #663

merged 1 commit into from
Jan 11, 2024

Conversation

jmarrec
Copy link
Collaborator

@jmarrec jmarrec commented Jan 8, 2024

Temporary workaround for #659 on mac. Just disabling the messagebox Invalid weather file object, weather file object has been reset. Please choose another weather file. Hopefully we find an actual fix, but in the meantime it's more important to be able to load a file than to see this warning messagebox.

@macumber
Copy link
Collaborator

The MessageBox in OpenStudioApp::versionUpdateMessageBox is not parented, the one in OSDocument::weatherFileReset is, I wonder if that makes any difference?

Went looking for any related Qt bugs:

https://bugreports.qt.io/browse/QTBUG-116622
https://bugreports.qt.io/browse/QTBUG-114546

@jmarrec
Copy link
Collaborator Author

jmarrec commented Jan 11, 2024

@macumber I tried this, doesn't work.

--- a/src/openstudio_app/OpenStudioApp.cpp
+++ b/src/openstudio_app/OpenStudioApp.cpp
@@ -1076,7 +1076,13 @@ void OpenStudioApp::childEvent(QChildEvent* event) {

 void OpenStudioApp::versionUpdateMessageBox(const osversion::VersionTranslator& translator, bool successful, const QString& fileName,
                                             const openstudio::path& tempModelDir) {
-  QMessageBox messageBox;
+
+  QWidget* parent = nullptr;
+
+  if (this->currentDocument()) {
+    parent = this->currentDocument()->mainWindow();
+  }
+  QMessageBox messageBox(parent);

I also tried a few more things including OSAppBase::mainWidget as I said here: #659 (comment)

@jmarrec jmarrec merged commit 8fc96e2 into develop Jan 11, 2024
8 checks passed
@jmarrec jmarrec deleted the 659-workaround branch January 11, 2024 23:41
@github-actions github-actions bot locked and limited conversation to collaborators Jan 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants