VirtualBox

Changeset 86781 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Nov 2, 2020 2:12:51 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9831. Putting qt version checks around search engine etc.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp

    r86776 r86781  
    2222#include <QFont>
    2323#include <QHBoxLayout>
    24 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP)
     24#if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
    2525 #include <QtHelp/QHelpEngine>
    2626 #include <QtHelp/QHelpContentWidget>
    2727 #include <QtHelp/QHelpIndexWidget>
    28 #include <QtHelp/QHelpSearchEngine>
    29 #include <QtHelp/QHelpSearchQueryWidget>
    30 #include <QtHelp/QHelpSearchResultWidget>
     28 #include <QtHelp/QHelpSearchEngine>
     29 #include <QtHelp/QHelpSearchQueryWidget>
     30 #include <QtHelp/QHelpSearchResultWidget>
    3131#endif
    3232#include <QMenu>
     
    9191private:
    9292
    93 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP)
     93#if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
    9494    const QHelpEngine* m_pHelpEngine;
    9595#endif
     
    103103UIHelpBrowserViewer::UIHelpBrowserViewer(const QHelpEngine *pHelpEngine, QWidget *pParent /* = 0 */)
    104104    :QTextBrowser(pParent)
    105 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP)
     105#if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
    106106    , m_pHelpEngine(pHelpEngine)
    107107#endif
    108108{
    109 #if !defined(RT_OS_LINUX) || !defined(VBOX_WITH_DOCS_QHELP)
     109#if !defined(RT_OS_LINUX) || !defined(VBOX_WITH_DOCS_QHELP) || !(QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
    110110    Q_UNUSED(pHelpEngine);
    111111#endif
     
    114114QVariant UIHelpBrowserViewer::loadResource(int type, const QUrl &name)
    115115{
    116 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP)
     116#if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
    117117    if (name.scheme() == "qthelp" && m_pHelpEngine)
    118118        return QVariant(m_pHelpEngine->fileData(name));
     
    143143    , m_pToolBar(0)
    144144    , m_strHelpFilePath(strHelpFilePath)
    145 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP)
     145#if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
    146146    , m_pHelpEngine(0)
    147147#endif
     
    240240
    241241    m_pMainLayout->addWidget(m_pSplitter);
    242 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP)
     242#if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
    243243    m_pHelpEngine = new QHelpEngine(m_strHelpFilePath, this);
    244244    m_pBookmarksWidget = new QWidget(this);
     
    302302void UIHelpBrowserWidget::prepareSearchWidgets()
    303303{
    304 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP)
     304#if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
    305305# if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)
    306306
     
    397397void UIHelpBrowserWidget::loadOptions()
    398398{
    399 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP)
     399#if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
    400400    if (m_pContentViewer && m_pHelpEngine)
    401401    {
     
    512512QUrl UIHelpBrowserWidget::findIndexHtml() const
    513513{
    514 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP)
     514#if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
    515515    QList<QUrl> files = m_pHelpEngine->files(m_pHelpEngine->namespaceName(m_strHelpFilePath), QStringList());
    516516    int iIndex = -1;
     
    552552void UIHelpBrowserWidget::sltHandleHelpEngineSetupFinished()
    553553{
    554 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP)
     554#if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
    555555    AssertReturnVoid(m_pContentViewer && m_pHelpEngine);
    556556    /* Search for the index of the index.htnl: */
     
    567567void UIHelpBrowserWidget::sltHandleContentWidgetItemClicked(const QModelIndex &index)
    568568{
    569 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP)
     569#if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
    570570    AssertReturnVoid(m_pContentViewer && m_pHelpEngine && m_pContentWidget);
    571571    QHelpContentModel *pContentModel =
     
    589589void UIHelpBrowserWidget::sltHandleHelpBrowserViewerSourceChange(const QUrl &source)
    590590{
    591 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP)
     591#if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
    592592    if (m_fModelContentCreated && m_pContentWidget && source.isValid() && m_pContentModel)
    593593    {
     
    714714void UIHelpBrowserWidget::sltHandleSearchStart()
    715715{
    716 #if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)
     716#if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
    717717    AssertReturnVoid(m_pHelpSearchEngine && m_pHelpSearchQueryWidget);
    718718    m_pHelpSearchEngine->search(m_pHelpSearchQueryWidget->searchInput());
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.h

    r86776 r86781  
    148148
    149149    QString       m_strHelpFilePath;
    150 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP)
     150#if defined(RT_OS_LINUX) && defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
    151151    QHelpEngine  *m_pHelpEngine;
    152152#endif
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette