4 #ifndef pqHelpWindowNoWebEngine_h 5 #define pqHelpWindowNoWebEngine_h 14 #include <QTextBrowser> 24 class pqTextBrowser :
public QTextBrowser
27 pqTextBrowser(QHelpEngine* helpEngine, QWidget* _parent =
nullptr)
29 this->HelpEngine = helpEngine;
30 this->setParent(_parent);
31 this->setOpenLinks(
false);
34 ~pqTextBrowser()
override =
default;
35 static pqTextBrowser* newInstance(QHelpEngine* engine,
pqHelpWindow*
self)
37 pqTextBrowser* instance =
new pqTextBrowser(engine,
self);
38 self->connect(instance, &pqTextBrowser::anchorClicked,
self,
45 void setUrl(
const QUrl& url) { this->setSource(url); }
61 bool canGoBackward() {
return this->isBackwardAvailable(); }
63 bool canGoForward() {
return this->isForwardAvailable(); }
70 QVariant loadResource(
int type,
const QUrl& url)
override 72 if (url.scheme() ==
"qthelp")
74 return QVariant(this->HelpEngine->fileData(url));
78 return QTextBrowser::loadResource(type, url);
81 QPointer<QHelpEngine> HelpEngine;
virtual void updateHistoryButtons()
Update the state of buttons used to navigate through history.
pqHelpWindow provides a assistant-like window for showing help provided by a QHelpEngine.
virtual void showPage(const QString &url)
Requests showing of a particular page.