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
8e7e4028
Commit
8e7e4028
authored
Jun 20, 2020
by
Alexander Semke
Browse files
Minor cleanup in the help panel plugin.
parent
3e81757c
Pipeline
#24491
passed with stage
in 19 minutes and 14 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/panelplugins/helppanel/helppanelplugin.cpp
View file @
8e7e4028
...
...
@@ -21,14 +21,11 @@
#include
"helppanelplugin.h"
#include
<KLocalizedString>
#include
<KTextEdit>
#include
"cantor_macros.h"
HelpPanelPlugin
::
HelpPanelPlugin
(
QObject
*
parent
,
QList
<
QVariant
>
args
)
:
Cantor
::
PanelPlugin
(
parent
)
HelpPanelPlugin
::
HelpPanelPlugin
(
QObject
*
parent
,
const
QList
<
QVariant
>
&
args
)
:
Cantor
::
PanelPlugin
(
parent
)
,
m_edit
(
nullptr
)
{
Q_UNUSED
(
args
);
m_edit
=
nullptr
;
}
HelpPanelPlugin
::~
HelpPanelPlugin
()
...
...
@@ -38,12 +35,13 @@ HelpPanelPlugin::~HelpPanelPlugin()
QWidget
*
HelpPanelPlugin
::
widget
()
{
if
(
m_edit
==
nullptr
)
if
(
!
m_edit
)
{
m_edit
=
new
KTextEdit
(
parentWidget
());
m_edit
=
new
KTextEdit
(
parentWidget
());
setHelpHtml
(
i18n
(
"<h1>Cantor</h1>The KDE way to do Mathematics"
));
m_edit
->
setTextInteractionFlags
(
Qt
::
TextBrowserInteraction
);
//using old-style syntax here, otherwise we'd need to include and link to CantorPart and KParts
connect
(
parent
()
->
parent
(),
SIGNAL
(
showHelp
(
QString
)),
this
,
SLOT
(
setHelpHtml
(
QString
)));
connect
(
parent
()
->
parent
(),
SIGNAL
(
showHelp
(
QString
)),
this
,
SIGNAL
(
visibilityRequested
()));
}
...
...
@@ -73,7 +71,5 @@ bool HelpPanelPlugin::showOnStartup()
return
false
;
}
K_PLUGIN_FACTORY_WITH_JSON
(
helppanelplugin
,
"helppanelplugin.json"
,
registerPlugin
<
HelpPanelPlugin
>
();)
#include
"helppanelplugin.moc"
src/panelplugins/helppanel/helppanelplugin.h
View file @
8e7e4028
...
...
@@ -23,14 +23,13 @@
#include
"panelplugin.h"
class
KTextEdit
;
class
HelpPanelPlugin
:
public
Cantor
::
PanelPlugin
{
Q_OBJECT
public:
HelpPanelPlugin
(
QObject
*
parent
,
QList
<
QVariant
>
args
);
HelpPanelPlugin
(
QObject
*
parent
,
const
QList
<
QVariant
>
&
args
);
~
HelpPanelPlugin
()
override
;
QWidget
*
widget
()
override
;
...
...
@@ -38,8 +37,8 @@ class HelpPanelPlugin : public Cantor::PanelPlugin
bool
showOnStartup
()
override
;
public
Q_SLOTS
:
void
setHelpHtml
(
const
QString
&
help
);
void
showHelp
(
const
QString
&
help
);
void
setHelpHtml
(
const
QString
&
);
void
showHelp
(
const
QString
&
);
private:
QPointer
<
KTextEdit
>
m_edit
;
...
...
Write
Preview
Supports
Markdown
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