Help: Make it possible to create multiple index views

This unfortunately means doing the filtering by hand,
because filtering on the QHelpIndexModel would be shared
between multiple views.

Change-Id: Iae38952a92dbb1b4a9685aea6f057d96f0d0784f
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Eike Ziller
2014-09-29 17:35:04 +02:00
parent a10f207756
commit 9cc88836f7
5 changed files with 299 additions and 77 deletions

View File

@@ -31,6 +31,7 @@
#include "helpviewer.h"
#include "localhelpmanager.h"
#include "openpagesmanager.h"
#include "topicchooser.h"
#include <utils/qtcassert.h>
@@ -76,10 +77,18 @@ CentralWidget *CentralWidget::instance()
return gStaticCentralWidget;
}
void CentralWidget::open(const QUrl &url, bool newPage)
{
if (newPage)
OpenPagesManager::instance().createPage(url);
else
setSource(url);
}
void CentralWidget::showTopicChooser(const QMap<QString, QUrl> &links,
const QString &keyword)
const QString &keyword, bool newPage)
{
TopicChooser tc(this, keyword, links);
if (tc.exec() == QDialog::Accepted)
setSource(tc.link());
open(tc.link(), newPage);
}