Commit 829adb5c authored by Shubham  .'s avatar Shubham .
Browse files

Add code for creating the qt output help files(.qch,.qhc) as well

parent b7c0eff6
......@@ -47,13 +47,15 @@ for fi in files:
fp.close()
#####################
#open required files#
#####################
index = open('./index.hhk', 'r')
# QtHelp files
qhp = open('./help.qhp', 'w')
qhcp = open('./help.qhcp', 'w')
#######################################
#code for generation of QtHelp files##
######################################
......@@ -208,7 +210,7 @@ qhcp.writelines("""<?xml version="1.0" encoding="utf-8" ?>
# this way does not work, because somehow beautifulsoup is unable to escape &gt and &gt;< special symbols
# this way to does not work, because somehowbeautifulsoupl is unable to escape &gt and &gt;< special symbols
# html = index.read()
# soup = BeautifulSoup(html, features='html.parser')
......@@ -252,6 +254,12 @@ qhp.writelines("""</keywords>
</QtHelpProject> """)
##############################################################
#qhp, qhcp input files are generate, now generate output files
#############################################################
stream = os.popen('qhelpgenerator help.qhcp -o help.qhc')
index.close()
qhp.close()
qhcp.close()
......@@ -122,6 +122,13 @@ void DocumentationPanelWidget::displayHelp(const QUrl& url)
m_textBrowser->setContent(contents, QLatin1String("text/html;charset=UTF-8"));
m_textBrowser->show();
int anchorPos = url.toString().indexOf(QLatin1Char('#'));
if (anchorPos >= 0)
{
QString anchor = url.toString().mid(anchorPos+1);
//m_textBrowser->page()->mainFrame()->scrollToAnchor(anchor);
}
qDebug() << url;
const QModelIndex index = m_engine->indexWidget()->currentIndex();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment