diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3303e5aa..a630b14c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,12 +12,17 @@ else() set( Qt Qt5 ) endif() +if ( ${QHELP} ) + set(QtHelpModule Help) + add_definitions( -D_USE_QHELP ) +endif() + if ( ${QT6} ) - find_package( Qt6 COMPONENTS Widgets Help OpenGL OpenGLWidgets REQUIRED) + find_package( Qt6 REQUIRED COMPONENTS Widgets OpenGL OpenGLWidgets ${QtHelpModule}) add_definitions( ${Qt6Widgets_DEFINITIONS} ${Qt6Help_DEFINITIONS} ${Qt6OpenGLWidgets_DEFINITIONS} ) include_directories( ${Qt6Widgets_INCLUDE_DIRS} ${Qt6Help_INCLUDE_DIRS} ${Qt6OpenGLWidgets_INCLUDE_DIRS} ) else() - find_package( Qt5 COMPONENTS Widgets OpenGL Help REQUIRED) + find_package( Qt5 REQUIRED COMPONENTS Widgets OpenGL ${QtHelpModule}) add_definitions( ${Qt5Widgets_DEFINITIONS} ${Qt5Help_DEFINITIONS} ) include_directories( ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Help_INCLUDE_DIRS} ) endif() diff --git a/src/drivers/Qt/ConsoleWindow.cpp b/src/drivers/Qt/ConsoleWindow.cpp index c0d7ec7c..d2b759ea 100644 --- a/src/drivers/Qt/ConsoleWindow.cpp +++ b/src/drivers/Qt/ConsoleWindow.cpp @@ -1862,6 +1862,7 @@ void consoleWin_t::createMainMenu(void) subMenu->addAction(act); +#if defined(WIN32) || defined(_USE_QHELP) // Help -> Documentation Offline act = new QAction(tr("&Local"), this); act->setStatusTip(tr("Documentation")); @@ -1869,6 +1870,7 @@ void consoleWin_t::createMainMenu(void) connect(act, SIGNAL(triggered()), this, SLOT(openOfflineDocs(void)) ); subMenu->addAction(act); +#endif }; //--------------------------------------------------------------------------- int consoleWin_t::loadVideoDriver( int driverId ) diff --git a/src/drivers/Qt/HelpPages.cpp b/src/drivers/Qt/HelpPages.cpp index 7172dabc..ec902ed3 100644 --- a/src/drivers/Qt/HelpPages.cpp +++ b/src/drivers/Qt/HelpPages.cpp @@ -28,9 +28,12 @@ #include #include #include + +#ifdef _USE_QHELP #include #include #include +#endif #include "driver.h" #include "Qt/HelpPages.h" @@ -111,9 +114,11 @@ void consoleWin_t::OpenHelpWindow(std::string subpage) } //helpWin = forkHelpFileViewer( helpFileViewer.c_str(), helpFileName.c_str() ); + #ifdef _USE_QHELP HelpDialog *win = new HelpDialog( helpFileName.c_str(), this); win->show(); + #endif #endif } @@ -230,6 +235,7 @@ std::string consoleWin_t::findHelpFile(void) //} //#endif +#ifdef _USE_QHELP //----------------------------------------------------------------------------------------------- //--- Help Page Dialog //----------------------------------------------------------------------------------------------- @@ -392,3 +398,4 @@ QVariant HelpBrowser::loadResource(int type, const QUrl &name) return QTextBrowser::loadResource(type, name); } //----------------------------------------------------------------------------------------------- +#endif // _USE_QHELP diff --git a/src/drivers/Qt/HelpPages.h b/src/drivers/Qt/HelpPages.h index 02866bea..9f071b6c 100644 --- a/src/drivers/Qt/HelpPages.h +++ b/src/drivers/Qt/HelpPages.h @@ -5,8 +5,10 @@ #include #include #include -#include #include + +#ifdef _USE_QHELP +#include #include class HelpBrowser : public QTextBrowser @@ -41,3 +43,5 @@ class HelpDialog : public QDialog void navBackwardAvailable(bool); void navForwardAvailable(bool); }; + +#endif