- Timestamp:
- Oct 19, 2020 7:26:43 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp
r86603 r86620 160 160 #ifdef RT_OS_LINUX 161 161 m_pHelpEngine = new QHelpEngine(m_strHelpFilePath, this); 162 connect(m_pHelpEngine, &QHelpEngine::setupFinished,163 this, &UIHelpBrowserWidget::sltHandleHelpEngineSetupFinished);164 162 165 163 m_pTabWidget = new QITabWidget; 166 164 AssertReturnVoid(m_pTabWidget); 165 AssertReturnVoid(m_pHelpEngine->contentWidget() && m_pHelpEngine->indexWidget()); 167 166 m_pSplitter->addWidget(m_pTabWidget); 168 167 m_pTabWidget->addTab(m_pHelpEngine->contentWidget(), tr("Contents")); … … 177 176 m_pSplitter->setChildrenCollapsible(false); 178 177 178 connect(m_pHelpEngine, &QHelpEngine::setupFinished, 179 this, &UIHelpBrowserWidget::sltHandleHelpEngineSetupFinished); 180 181 connect(m_pHelpEngine->contentWidget(), &QHelpContentWidget::linkActivated, 182 m_pTextBrowser, &UIHelpBrowserViewer::setSource); 183 connect(m_pHelpEngine->contentWidget(), &QHelpContentWidget::clicked, 184 this, &UIHelpBrowserWidget::sltHandleContentWidgetItemClicked); 185 186 187 connect(m_pHelpEngine->indexWidget(), &QHelpIndexWidget::linkActivated, 188 m_pTextBrowser, &UIHelpBrowserViewer::setSource); 189 179 190 if (QFile(m_strHelpFilePath).exists() && m_pHelpEngine) 180 191 m_pHelpEngine->setupData(); 181 182 192 #endif 183 193 } … … 270 280 } 271 281 282 void UIHelpBrowserWidget::sltHandleContentWidgetItemClicked(const QModelIndex &index) 283 { 284 #ifdef RT_OS_LINUX 285 AssertReturnVoid(m_pTextBrowser && m_pHelpEngine && m_pHelpEngine->contentWidget()); 286 QHelpContentModel *pContentModel = 287 qobject_cast<QHelpContentModel*>(m_pHelpEngine->contentWidget()->model()); 288 if (!pContentModel) 289 return; 290 QHelpContentItem *pItem = pContentModel->contentItemAt(index); 291 if (!pItem) 292 return; 293 const QUrl &url = pItem->url(); 294 m_pTextBrowser->setSource(url); 295 #endif 296 } 297 298 272 299 #include "UIHelpBrowserWidget.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.h
r86603 r86620 85 85 86 86 void sltHandleHelpEngineSetupFinished(); 87 void sltHandleContentWidgetItemClicked(const QModelIndex &index); 87 88 88 89 private:
Note:
See TracChangeset
for help on using the changeset viewer.