Commit d248a7dd authored by kh1's avatar kh1
Browse files

Make use of the now available gui help engine.

parent 10a3699c
......@@ -28,7 +28,9 @@
**************************************************************************/
#include "contentwindow.h"
#include "centralwidget.h"
#include "helpmanager.h"
#include <QtGui/QLayout>
#include <QtGui/QFocusEvent>
......@@ -38,11 +40,10 @@
#include <QtHelp/QHelpContentWidget>
ContentWindow::ContentWindow(QHelpEngine *helpEngine)
: m_helpEngine(helpEngine)
, m_contentWidget(0)
: m_contentWidget(0)
, m_expandDepth(-2)
{
m_contentWidget = m_helpEngine->contentWidget();
m_contentWidget = (&Help::HelpManager::helpEngine())->contentWidget();
m_contentWidget->installEventFilter(this);
m_contentWidget->viewport()->installEventFilter(this);
m_contentWidget->setContextMenuPolicy(Qt::CustomContextMenu);
......
......@@ -66,7 +66,6 @@ private:
bool eventFilter(QObject *o, QEvent *e);
bool isPdfFile(QHelpContentItem *item) const;
QHelpEngine *m_helpEngine;
QHelpContentWidget *m_contentWidget;
int m_expandDepth;
};
......
......@@ -27,8 +27,9 @@
**
**************************************************************************/
#include "indexwindow.h"
#include "centralwidget.h"
#include "helpmanager.h"
#include "indexwindow.h"
#include "topicchooser.h"
#include <QtGui/QLayout>
......@@ -46,7 +47,6 @@ IndexWindow::IndexWindow(QHelpEngine *helpEngine, QWidget *parent)
: QWidget(parent)
, m_searchLineEdit(0)
, m_indexWidget(0)
, m_helpEngine(helpEngine)
{
QVBoxLayout *layout = new QVBoxLayout(this);
QLabel *l = new QLabel(tr("&Look for:"));
......@@ -61,11 +61,12 @@ IndexWindow::IndexWindow(QHelpEngine *helpEngine, QWidget *parent)
layout->setMargin(4);
layout->addWidget(m_searchLineEdit);
m_indexWidget = m_helpEngine->indexWidget();
QHelpEngine *engine = &Help::HelpManager::helpEngine();
m_indexWidget = engine->indexWidget();
m_indexWidget->installEventFilter(this);
connect(m_helpEngine->indexModel(), SIGNAL(indexCreationStarted()), this,
connect(engine->indexModel(), SIGNAL(indexCreationStarted()), this,
SLOT(disableSearchLineEdit()));
connect(m_helpEngine->indexModel(), SIGNAL(indexCreated()), this,
connect(engine->indexModel(), SIGNAL(indexCreated()), this,
SLOT(enableSearchLineEdit()));
connect(m_indexWidget, SIGNAL(linkActivated(QUrl, QString)), this,
SIGNAL(linkActivated(QUrl)));
......
......@@ -73,7 +73,6 @@ private:
QLineEdit *m_searchLineEdit;
QHelpIndexWidget *m_indexWidget;
QHelpEngine *m_helpEngine;
};
#endif // INDEXWINDOW_H
Supports Markdown
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