Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
Cantor
Commits
f5f50eb9
Commit
f5f50eb9
authored
Jun 19, 2020
by
Shubham .
Browse files
Add QTextBrowser as viewing widget and remove some unnecessary code
parent
7d7b69fa
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/cantor.cpp
View file @
f5f50eb9
...
...
@@ -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"
...
...
src/cantor_part.cpp
View file @
f5f50eb9
...
...
@@ -741,7 +741,7 @@ void CantorPart::enableTypesetting(bool enable)
void
CantorPart
::
showBackendHelp
()
{
qDebug
()
<<
"
s
howing backends help"
;
qDebug
()
<<
"
S
howing backend
'
s help"
;
auto
*
backend
=
m_worksheet
->
session
()
->
backend
();
QUrl
url
=
backend
->
helpUrl
();
qDebug
()
<<
"launching url "
<<
url
;
...
...
src/panelplugins/documentationpanel/documentationpanelplugin.cpp
View file @
f5f50eb9
...
...
@@ -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
)
...
...
src/panelplugins/documentationpanel/documentationpanelplugin.h
View file @
f5f50eb9
...
...
@@ -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
;
...
...
src/panelplugins/documentationpanel/documentationpanelwidget.cpp
View file @
f5f50eb9
...
...
@@ -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
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment