| 379 | } // unnamed namespace |
| 380 | |
| 381 | QWidget* QtHelpDocumentation::documentationWidget(DocumentationFindWidget* findWidget, QWidget* parent) |
| 382 | { |
| 383 | if(m_info.isEmpty()) { //QtHelp sometimes has empty info maps. e.g. availableaudioeffects i 4.5.2 |
| 384 | return new QLabel(i18n("Could not find any documentation for '%1'", m_name), parent); |
| 385 | } else { |
| 386 | auto* view = new StandardDocumentationView(findWidget, parent); |
| 387 | view->initZoom(m_provider->name()); |
| 388 | view->setDelegateLinks(true); |
| 389 | view->installUrlSchemeHandler(QByteArrayLiteral("qthelp"), new QtHelpSchemeHandler(m_provider, this)); |
| 390 | view->setContextMenuPolicy(Qt::CustomContextMenu); |
| 391 | QObject::connect(view, &StandardDocumentationView::linkClicked, this, &QtHelpDocumentation::jumpedTo); |
| 392 | connect(view, &StandardDocumentationView::customContextMenuRequested, this, &QtHelpDocumentation::viewContextMenuRequested); |
| 393 | |
| 394 | view->load(currentUrl()); |
| 395 | return view; |
| 396 | } |
| 397 | } |
| 398 | |
| 399 | void QtHelpDocumentation::viewContextMenuRequested(const QPoint& pos) |
| 400 | { |
nothing calls this directly
no test coverage detected