11 printf(
"QxrdHelpBrowser::QxrdHelpBrowser(%p)\n",
this);
18 printf(
"QxrdHelpBrowser::~QxrdHelpBrowser(%p)\n",
this);
38 if (type == QTextDocument::HtmlResource) {
39 if (name.scheme() ==
"qrc") {
40 if (name.path() ==
"/help/autohelp") {
42 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
43 QByteArray res = engine->helpText(name.query());
45 QByteArray res = engine->helpText(name.encodedQuery());
50 }
else if (name.path() ==
"/help/macrocounter") {
51 QByteArray res =
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"
54 " <title>QXRD Spec Macro Counter</title>\n"
58 " <h1>QXRD Spec Macro Counter</h1>\n"
61 QFile macroFile(
":/qxrd_macrocounter.mac");
63 if (macroFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
64 QByteArray macros = macroFile.readAll();
66 macros.replace(
"&",
"&");
67 macros.replace(
"<",
"<");
68 macros.replace(
">",
">");
72 res.append(
"Couldn't open macro file");
75 res.append(
" </pre></code></p>\n"
86 QVariant res = QTextBrowser::loadResource(type, name);
QSharedPointer< QxrdExperiment > QxrdExperimentPtr
qint64 qcepDebug(int cond)
QxrdHelpBrowser(QWidget *parent=0)
QSharedPointer< QxrdScriptEngine > QxrdScriptEnginePtr
void init(QxrdExperimentWPtr expt)
QWeakPointer< QxrdExperiment > QxrdExperimentWPtr
QVariant loadResource(int type, const QUrl &name)
QxrdExperimentWPtr m_Experiment
virtual ~QxrdHelpBrowser()