diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-03-12 09:24:28 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-03-12 11:44:52 +0000 |
commit | 9c5de3ed310d63a2021d062013ad9779d33028d0 (patch) | |
tree | 9aab83cadfad8d0057d2fa2fe7725d9613e933c9 /sources/pyside2 | |
parent | 6e3fba8f4ac75645480bb12216f46eeb413c2936 (diff) |
PySide2: Fix documentation build with module subsets
Document the tabbedbrowser tutorial only when QtWebEngineWidgets are
present. Otherwise, the sphinx run will fail since autodoc cannot
import the QtWebEngineWidget Python module.
Change-Id: I23e671e15aa1725b20e4d0db17942f3fbc04bf20
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/pyside2')
-rw-r--r-- | sources/pyside2/doc/CMakeLists.txt | 3 | ||||
-rw-r--r-- | sources/pyside2/doc/conf.py.in | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/sources/pyside2/doc/CMakeLists.txt b/sources/pyside2/doc/CMakeLists.txt index eb5200e85..b5bde885a 100644 --- a/sources/pyside2/doc/CMakeLists.txt +++ b/sources/pyside2/doc/CMakeLists.txt @@ -28,6 +28,8 @@ configure_file("pyside-config.qdocconf.in" "${CMAKE_CURRENT_LIST_DIR}/pyside-con file(READ "${pyside2_BINARY_DIR}/pyside2_global.h" docHeaderContents) file(READ "typesystem_doc.xml.in" typeSystemDocXmlContents) +set(HAS_WEBENGINE_WIDGETS 0) + foreach(moduleIn ${all_module_shortnames}) string(TOLOWER "${moduleIn}" lowerModuleIn) set(docConf "${CMAKE_CURRENT_LIST_DIR}/qtmodules/pyside-qt${lowerModuleIn}.qdocconf.in") @@ -45,6 +47,7 @@ foreach(moduleIn ${all_module_shortnames}) set(modules Multimedia "${moduleIn}") elseif ("${moduleIn}" STREQUAL "WebEngineWidgets") set(modules WebEngine WebEngineCore "${moduleIn}") + set(HAS_WEBENGINE_WIDGETS 1) else() set(modules "${moduleIn}") endif() diff --git a/sources/pyside2/doc/conf.py.in b/sources/pyside2/doc/conf.py.in index 99b74deef..0b66d34d5 100644 --- a/sources/pyside2/doc/conf.py.in +++ b/sources/pyside2/doc/conf.py.in @@ -18,7 +18,8 @@ import sys, os # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.append('@CMAKE_CURRENT_SOURCE_DIR@') sys.path.append('@pyside_BINARY_DIR@') -sys.path.append('@CMAKE_CURRENT_SOURCE_DIR@/../../../examples/webenginewidgets/tabbedbrowser') +if @HAS_WEBENGINE_WIDGETS@: + sys.path.append('@CMAKE_CURRENT_SOURCE_DIR@/../../../examples/webenginewidgets/tabbedbrowser') # -- General configuration ----------------------------------------------------- |