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

[SofaGui] Pass QDocBrowser as an option #1315

Merged
merged 4 commits into from
May 6, 2020

Conversation

epernod
Copy link
Contributor

@epernod epernod commented Apr 2, 2020

  • QDocBrowser will be build by default if Qt5WebEngine is found.
  • Add option in cmake to enable the QDocBrowser (If I did it well) that will set Qt5WebEngine as required to warn user to install it if they want the browser.

This PR:

  • builds with SUCCESS for all platforms on the CI.
  • does not generate new warnings.
  • does not generate new unit test failures.
  • does not generate new scene test failures.
  • does not break API compatibility.
  • is more than 1 week old (or has fast-merge label).

Reviewers will merge only if all these checks are true.

…he computer. Set an option to force it if wanted.
@epernod epernod added pr: status to review To notify reviewers to review this pull-request location: project pr: clean Cleaning the code labels Apr 2, 2020
@guparan
Copy link
Contributor

guparan commented Apr 3, 2020

Thanks @epernod but why?
@damienmarchal, your opinion on this?

@epernod epernod self-assigned this Apr 3, 2020
@epernod
Copy link
Contributor Author

epernod commented Apr 3, 2020

I did like for QtChart. As it is not a module installed by default in Qt.
Otherwise be sure to tell user to install that module when installing Qt.

@jnbrunet
Copy link
Contributor

jnbrunet commented Apr 3, 2020

Just my 2 cents, if there is an option to disable it, I'll probably use it even tho I have Qt5WebEngine installed, since I like to keep only the minimum options activated to reduce compilation time and I don't think I'll use this feature.

@damienmarchal
Copy link
Contributor

Hi all,

Thanks Erik for the PR.

I'm not opposed to have this kind of option but I think it would be better to have and implementation that is not based on #ifdef (for reason we already discussed a lot).

@hugtalbot hugtalbot added pr: status wip Development in the pull-request is still in progress and removed pr: status to review To notify reviewers to review this pull-request labels Apr 8, 2020
Copy link
Contributor

@guparan guparan left a comment

Choose a reason for hiding this comment

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

  • I would rename SOFAGUIQT_ENABLE_DOCBROWSER into SOFAGUIQT_ENABLE_QDOCBROWSER
  • To avoid duplicated variables, use SOFAGUIQT_HAVE_QT5_WEBENGINE in code.
  • In applications/sofa/gui/qt/SofaGuiQt.h.in, you have to add:
    #cmakedefine01 SOFAGUIQT_HAVE_QT5_WEBENGINE

Comment on lines 21 to 32
#QDocBrowser
option(SOFAGUIQT_ENABLE_DOCBROWSER "Build the QDocBrowser. Qt5WebEngine is needed." OFF)
if (SOFAGUIQT_ENABLE_DOCBROWSER)
sofa_find_package(Qt5 COMPONENTS WebEngine WebEngineWidgets REQUIRED BOTH_SCOPES)
else()
sofa_find_package(Qt5 COMPONENTS WebEngine WebEngineWidgets QUIET BOTH_SCOPES)
endif()
sofa_set_01(SOFAGUIQT_HAVE_DOCBROWSER VALUE ${SOFAGUIQT_ENABLE_DOCBROWSER} BOTH_SCOPES)

if (Qt5WebEngine_FOUND)
set(QT_TARGETS ${QT_TARGETS} Qt5::WebEngine Qt5::WebEngineWidgets)
endif()
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be enough:

# QDocBrowser
option(SOFAGUIQT_ENABLE_QDOCBROWSER "Build the QDocBrowser. Qt5WebEngine is needed." OFF)
if (SOFAGUIQT_ENABLE_QDOCBROWSER)
    sofa_find_package(Qt5 COMPONENTS WebEngine WebEngineWidgets REQUIRED BOTH_SCOPES)
    set(QT_TARGETS ${QT_TARGETS} Qt5::WebEngine Qt5::WebEngineWidgets)
endif()

@hugtalbot
Copy link
Contributor

If a solution is not found on the crash closing SOFA, I really ++++ this PR

…check if (SOFAGUIQT_HAVE_QT5_WEBENGINE) in code
@epernod epernod requested a review from guparan May 4, 2020 22:42
@epernod epernod added pr: status to review To notify reviewers to review this pull-request and removed pr: status wip Development in the pull-request is still in progress labels May 5, 2020
@guparan
Copy link
Contributor

guparan commented May 5, 2020

I added the missing "enable by default if QDocBrowser is found" part 😉
Looks good now!

@hugtalbot
Copy link
Contributor

It does fix my bug (prev!) @fredroy 👍
Problem did come from QtWebEng.

@hugtalbot hugtalbot added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels May 6, 2020
@guparan guparan merged commit dda536f into sofa-framework:master May 6, 2020
@epernod epernod deleted the inf_option_docbrowser branch May 14, 2020 09:06
@guparan guparan added this to the v20.06 milestone Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: clean Cleaning the code pr: status ready Approved a pull-request, ready to be squashed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants