VirtualBox

Changeset 86603 in vbox for trunk


Ignore:
Timestamp:
Oct 16, 2020 11:02:57 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9831. Adding tabs for toc and index.

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

Legend:

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

    r86584 r86603  
    2020#include <QDir>
    2121#include <QFont>
     22#include <QHBoxLayout>
    2223#ifdef RT_OS_LINUX
    2324 #include <QtHelp/QHelpEngine>
    2425 #include <QtHelp/QHelpContentWidget>
     26 #include <QtHelp/QHelpIndexWidget>
    2527#endif
    2628#include <QMenu>
    2729#include <QScrollBar>
    2830#include <QStyle>
     31#include <QSplitter>
    2932#include <QTextBrowser>
    30 #include <QHBoxLayout>
    3133#ifdef RT_OS_SOLARIS
    3234# include <QFontDatabase>
     
    108110#endif
    109111    , m_pTextBrowser(0)
     112    , m_pSplitter(0)
    110113{
    111114    /* Prepare VM Log-Viewer: */
     
    150153    /* Create main layout: */
    151154    m_pMainLayout = new QHBoxLayout(this);
    152     AssertReturnVoid(m_pMainLayout);
     155    m_pSplitter = new QSplitter;
     156
     157    AssertReturnVoid(m_pMainLayout && m_pSplitter);
     158
     159    m_pMainLayout->addWidget(m_pSplitter);
    153160#ifdef RT_OS_LINUX
    154161    m_pHelpEngine = new QHelpEngine(m_strHelpFilePath, this);
     
    156163            this, &UIHelpBrowserWidget::sltHandleHelpEngineSetupFinished);
    157164
    158     // m_pTabWidget = new QITabWidget;
    159     // m_pMainLayout->addWidget(m_pTabWidget);
     165    m_pTabWidget = new QITabWidget;
     166    AssertReturnVoid(m_pTabWidget);
     167    m_pSplitter->addWidget(m_pTabWidget);
     168    m_pTabWidget->addTab(m_pHelpEngine->contentWidget(), tr("Contents"));
     169    m_pTabWidget->addTab(m_pHelpEngine->indexWidget(), tr("Index"));
     170
    160171    m_pTextBrowser = new UIHelpBrowserViewer(m_pHelpEngine);
    161172    AssertReturnVoid(m_pTextBrowser);
    162     m_pMainLayout->addWidget(m_pTextBrowser);
     173    m_pSplitter->addWidget(m_pTextBrowser);
     174
     175    m_pSplitter->setStretchFactor(0, 1);
     176    m_pSplitter->setStretchFactor(1, 4);
     177    m_pSplitter->setChildrenCollapsible(false);
    163178
    164179    if (QFile(m_strHelpFilePath).exists() && m_pHelpEngine)
    165     {
    166         bool fSetupResult = m_pHelpEngine->setupData();
    167         //m_pHelpEngine->registerDocumentation(m_strHelpFilePath));
    168         printf("setup data %d %s\n", fSetupResult, qPrintable(m_strHelpFilePath));
    169     }
     180        m_pHelpEngine->setupData();
     181
    170182#endif
    171183}
     
    251263#ifdef RT_OS_LINUX
    252264    AssertReturnVoid(m_pTextBrowser && m_pHelpEngine);
    253 
    254265    QList<QUrl> files = m_pHelpEngine->files(m_pHelpEngine->namespaceName(m_strHelpFilePath), QStringList());
    255266    if (!files.empty())
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.h

    r86583 r86603  
    4545class UIActionPool;
    4646class UIDialogPanel;
     47class QSplitter;
    4748
    4849/** QWidget extension providing GUI for VirtualBox LogViewer. It
     
    130131#endif
    131132    UIHelpBrowserViewer *m_pTextBrowser;
     133    QSplitter           *m_pSplitter;
    132134};
    133135
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