-
Notifications
You must be signed in to change notification settings - Fork 25
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 #95 - Make Geometry Preview work on Ubuntu 20.04 (workaround) #342
Conversation
connect(m_view, &QWebEngineView::loadFinished, this, &PreviewWebView::onLoadFinished); | ||
//connect(m_view, &QWebEngineView::loadProgress, this, &PreviewWebView::onLoadProgress); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These drive the progress bar when loading right? That is useful for feedback when loading large models, can we keep these lines?
m_view->settings()->setAttribute(QWebEngineSettings::WebAttribute::SpatialNavigationEnabled, true); | ||
|
||
/* | ||
m_view->settings()->setAttribute(QWebEngineSettings::JavascriptCanAccessClipboard, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You think these are unneeded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They weren't enabled before. During testing I enabled them, but it didn't make any difference
// QUrl previewURL("qrc:///library/geometry_preview.html"); | ||
m_view->load(previewURL); | ||
|
||
// Local FileSystem: This works on Ubuntu 20.04 as well.... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So maybe something is broken loading html from a QRC on Ubuntu 20.04?
Wow, thanks for digging into this @jmarrec, I will build and test on Ubuntu 20.04 and Windows. It seems like some of the debugging stuff can get reverted but the overall approach seems to be ok (read QRC to string then call setHtml), seems like maybe there is a bug reading html from QRC? It's possible we could make that a platform dependent switch? |
As noted on #233 we should update to the newest ThreeJS at some point. https://www.ladybug.tools/spider-2020/spider-idf-viewer/ should be a good example |
Fix #95
It took me 6 hours to find a workaround to make it work... I have an open stack overflow question here: https://stackoverflow.com/questions/67692525/cannot-load-qrc-html-file-in-qwebengineview-on-ubuntu-20-04-only
For now, we'll just read the entire content of the HTML file, then call QWebEngineView::setHtml ...
What's driving me insane is that it works with GeometryEditorView:
OpenStudioApplication/src/openstudio_lib/GeometryEditorView.cpp
Line 240 in e47cbb1
Edit: Bumped ThreeJS version instead