QHelpEngine how-to
-
[SOLVED]
I don't know it is appropriate to ask the question here (if not please say so i'll start a new topic)
I have the problem with an error, it happens when calling the setCollectionFile() funtion of QHelpEngine.
@void HelperWindow::initialize()
{
HelperWindow::setWindowFlags(Qt::WindowStaysOnTopHint);m_helpEngine->setCollectionFile(QApplication::applicationDirPath() + "doc/athleticsmanager.qhc"); m_helpEngine->setupData();
}@
When i look deeper into the code behind this function i get this:
@if (fileName == collectionFile())
return;@It's in the collectionFile() function, that only does
@return d->collectionHandler->collectionFile();@, where i get "Segmentation Fault"
I dont really know what to do now, is there someone who can help me with this problem?
-
I encounter quietly the same problem:
- I am able to load my "doc.qhc" using the Qt Assistant and the content widget contains my documentation sections
- my "doc.qhc" and "doc.qch" are located in the same directory
- when building my help widget (see code below), no error is encountered
- my content widget is empty (the content model has 0 rows)
@
QFileInfo info("doc.qhc");
if (info.exists() == false)
{
qDebug << "Help file does not exist";
}
m_engine = new QHelpEngine(info.absoluteFilePath());
if (m_engine->setupData() == false)
{
qDebug << "Help engine setup failed";
}
QGridLayout* layout = new QGridLayout;
QSplitter* helpPanel = new QSplitter(Qt::Horizontal);
helpPanel->insertWidget(0, m_engine->contentWidget());
m_webView = new QWebView;
helpPanel->insertWidget(1, m_webView);
layout->addWidget(helpPanel, 0, 0);
setLayout(layout);
connect(m_engine->contentWidget(), SIGNAL(linkActivated(QUrl)), SLOT(SetHelpSource(QUrl)));
qDebug() << m_engine->contentModel()->rowCount());
@
I had a look on the Qt Assistant source code and it seems to do the same thing to load a collection file...or I missed something.
Any suggestion?
Thanks in advance for your help