Commit f5f50eb9 authored by Shubham  .'s avatar Shubham .
Browse files

Add QTextBrowser as viewing widget and remove some unnecessary code

parent 7d7b69fa
......@@ -32,12 +32,12 @@
#include <QApplication>
#include <QCloseEvent>
#include <QDebug>
#include <QDockWidget>
#include <QDir>
#include <QDockWidget>
#include <QFileDialog>
#include <QGraphicsView>
#include <QPushButton>
#include <QRegularExpression>
#include <QGraphicsView>
#include "lib/backend.h"
#include "lib/panelpluginhandler.h"
......
......@@ -741,7 +741,7 @@ void CantorPart::enableTypesetting(bool enable)
void CantorPart::showBackendHelp()
{
qDebug()<<"showing backends help";
qDebug()<<"Showing backend's help";
auto* backend = m_worksheet->session()->backend();
QUrl url = backend->helpUrl();
qDebug()<<"launching url "<<url;
......
......@@ -31,12 +31,6 @@ DocumentationPanelPlugin::~DocumentationPanelPlugin()
delete m_widget;
}
/*void DocumentationPanelPlugin::onSessionChanged()
{
if(m_widget)
m_widget->setSession(session());
}*/
QWidget* DocumentationPanelPlugin::widget()
{
if(m_widget == nullptr)
......
......@@ -38,9 +38,6 @@ class DocumentationPanelPlugin : public Cantor::PanelPlugin
bool showOnStartup() override;
void setShowOnStartup(bool);
/*protected:
void onSessionChanged() override;*/
private:
bool m_showAtStart;
QPointer<DocumentationPanelWidget> m_widget;
......
......@@ -28,6 +28,7 @@
#include <QByteArray>
#include <QDebug>
#include <QDir>
#include <QHBoxLayout>
#include <QHelpContentWidget>
#include <QHelpEngine>
#include <QHelpIndexWidget>
......@@ -59,18 +60,17 @@ void DocumentationPanelWidget::setSession(Cantor::Session* session)
void DocumentationPanelWidget::addWidgets()
{
//QPointer<QSplitter> m_splitter;
//QPointer<QTextBrowser> m_textBrowser;
//m_engine = new QHelpEngine(QApplication::applicationDirPath() + QLatin1String("/documentation/maxima_help_collection.qhc"), this);
m_engine = new QHelpEngine(QApplication::applicationDirPath() + QLatin1String("admin/documentation/maxima_help_collection.qhc"), this);
m_engine->setupData();
QByteArray helpData = m_engine->fileData(QUrl(QLatin1String("qthelp://org.kde.cantor/doc/maxima_7.html#SEC36")));
if( !m_engine->setupData() ) {
qWarning() << "Couldn't setup QtHelp Collection file";
}
if (!helpData.isEmpty())
qDebug() << helpData;
QByteArray helpData = m_engine->fileData(QUrl(QLatin1String("qthelp://org.kde.cantor/doc/maxima_7.html#SEC36")));
QPointer<QTabWidget> m_tabWidget = new QTabWidget;
QPointer<QTabWidget> m_tabWidget = new QTabWidget(this);
m_tabWidget->setMaximumWidth(1000);
m_tabWidget->setMinimumWidth(500);
m_tabWidget->setMovable(true);
......@@ -78,8 +78,13 @@ void DocumentationPanelWidget::addWidgets()
m_tabWidget->addTab(m_engine->indexWidget(), i18n("Index"));
m_tabWidget->addTab(m_engine->contentWidget(), i18n("Contents"));
QPointer<QTextBrowser> m_textBrowser = new QTextBrowser(this);
m_textBrowser->setSource(QUrl(QLatin1String("qthelp://org.kde.cantor/doc/maxima_7.html#SEC36")), QTextDocument::HtmlResource);
QVBoxLayout* layout = new QVBoxLayout(this);
layout->addWidget(m_tabWidget, 1);
layout->addWidget(m_textBrowser, 2);
// Connect to various signals and slots
}
......
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