Note that this is not the same as the help browser built into the IDE.
-Since the Qt WebEngine dependency is hefty and difficult to install on some systems, it is possible for sclang to have been built without WebView support (using the CMake flag code:: -DQT_WEBENGINE=OFF :: at compile). If so, attempting to invoke this class will throw an error.
+Since the Qt WebEngine dependency is hefty and difficult to install on some systems, it is possible for sclang to have been built without WebView support (using the CMake flag code:: -DSC_USE_WEBENGINE=OFF :: at compile). If so, attempting to invoke this class will throw an error.
classmethods::
private:: getOldWrapUrl, initClass
WebView displays web pages and provides all the standard browsing functionality.
-Since the Qt WebEngine dependency is hefty and difficult to install on some systems, it is possible for sclang to have been built without WebView support (using the CMake flag code:: -DQT_WEBENGINE=OFF :: at compile). If so, attempting to invoke this class will throw an error.
+Since the Qt WebEngine dependency is hefty and difficult to install on some systems, it is possible for sclang to have been built without WebView support (using the CMake flag code:: -DSC_USE_WEBENGINE=OFF :: at compile). If so, attempting to invoke this class will throw an error.
CLASSMETHODS::
set(REQUIRED_QT_VERSION 5.7)
-option(QT_WEBENGINE "Build with Qt WebEngine." ON)
+option(SC_USE_WEBENGINE "Build with Qt WebEngine." ON)
###############################################################################
# Components and libraries
Qt5::Quick Qt5::Qml Qt5::Sql Qt5::OpenGL Qt5::Svg
${MATH_LIBRARY})
-if(QT_WEBENGINE)
+if(SC_USE_WEBENGINE)
list(APPEND QT_COMPONENTS WebEngine WebEngineCore WebEngineWidgets)
list(APPEND QT_COLLIDER_LIBS Qt5::WebEngineCore Qt5::WebEngineWidgets)
endif()
list(APPEND QT_COLLIDER_SRCS ${QT_COLLIDER_DIR}/LanguageClient.cpp)
endif()
-if(QT_WEBENGINE)
+if(SC_USE_WEBENGINE)
list(APPEND QT_COLLIDER_HDRS
${QT_COLLIDER_DIR}/widgets/QcWebView.h
${QT_COLLIDER_DIR}/widgets/web_page.hpp
QC_ADD_FACTORY(QcGridLayout);
QC_ADD_FACTORY(QcStackLayout);
QC_ADD_FACTORY(QtDownload);
-#ifdef QT_WEBENGINE
+#ifdef SC_USE_WEBENGINE
QC_ADD_FACTORY(WebView);
#endif
#ifdef __APPLE__
#include <QEventLoop>
#include <QDir>
-#ifdef QT_WEBENGINE
+#ifdef SC_USE_WEBENGINE
# include <QWebEngineSettings>
#endif
gSystemPalette = qcApp->palette();
-#ifdef QT_WEBENGINE
+#ifdef SC_USE_WEBENGINE
// Enable javascript localStorage for WebViews
QWebEngineSettings::globalSettings()->setAttribute(QWebEngineSettings::LocalStorageEnabled, true);
#endif
#include <QStyleOptionSlider>
#include <QPainter>
-#ifdef QT_WEBENGINE
+#ifdef SC_USE_WEBENGINE
# include <QWebEngineView>
#endif
void ProxyStyle::drawComplexControl(ComplexControl ctrl, const QStyleOptionComplex* opt, QPainter* p,
const QWidget* w) const {
-#ifdef QT_WEBENGINE
+#ifdef SC_USE_WEBENGINE
// FIXME: this is a workaround for the WebKit bug #104116 (or a variation on it).
if (ctrl == QStyle::CC_ScrollBar && qobject_cast<const QWebEngineView*>(w) != 0
&& opt->type == QStyleOption::SO_Slider) {
QProxyStyle::drawComplexControl(ctrl, &opt2, p, w);
return;
}
-#endif // QT_WEBENGINE
+#endif // SC_USE_WEBENGINE
if (ctrl == QStyle::CC_ScrollBar && AlwaysShowScrollbars()) {
const QStyleOptionSlider* optSlider = static_cast<const QStyleOptionSlider*>(opt);
message(STATUS "Found Qt: " ${QtCore_location} )
get_filename_component(QT_BIN_PATH ${QtCore_location} DIRECTORY CACHE)
- if(QT_WEBENGINE)
+ if(SC_USE_WEBENGINE)
message(STATUS "Building with QtWebEngine")
- target_compile_definitions(libsclang PUBLIC QT_WEBENGINE)
+ target_compile_definitions(libsclang PUBLIC SC_USE_WEBENGINE)
endif()
target_link_libraries(libsclang ${QT_COLLIDER_LIBS})
endif()