Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
KmPlot
Commits
551b41c7
Commit
551b41c7
authored
Oct 18, 2018
by
Yuri Chornoivan
Browse files
Port KmPlot away from deprecated KStatusBar and kdelibs4support at all
Differential Revision:
https://phabricator.kde.org/D16133
parent
5ec2e1db
Changes
13
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
551b41c7
...
...
@@ -21,7 +21,6 @@ find_package (KF5 REQUIRED
Parts
WidgetsAddons
DocTools
KDELibs4Support
DBusAddons
)
...
...
kmplot/CMakeLists.txt
View file @
551b41c7
...
...
@@ -61,7 +61,7 @@ add_library(kmplotpart MODULE ${kmplotpart_PART_SRCS})
target_link_libraries
(
kmplotpart
KF
5::
KDELibs4Support
KF5::Parts Qt5::Svg
)
target_link_libraries
(
kmplotpart
Qt
5::
PrintSupport Qt5::Widgets
KF5::Parts Qt5::Svg
)
install
(
TARGETS kmplotpart DESTINATION
${
PLUGIN_INSTALL_DIR
}
)
...
...
@@ -78,7 +78,7 @@ ecm_add_app_icon(kmplot_SRCS ICONS ${ICONS_SRCS})
add_executable
(
kmplot
${
kmplot_SRCS
}
)
target_link_libraries
(
kmplot
KF
5::
Crash KF5::KDELibs4Support
KF5::Parts KF5::DBusAddons
)
target_link_libraries
(
kmplot
Qt
5::
PrintSupport Qt5::Widgets KF5::Crash
KF5::Parts KF5::DBusAddons
)
install
(
TARGETS kmplot
${
INSTALL_TARGETS_DEFAULT_ARGS
}
)
...
...
kmplot/functioneditor.cpp
View file @
551b41c7
...
...
@@ -34,9 +34,8 @@
#include
"view.h"
#include
"xparser.h"
#include
<kaction.h>
#include
<kcolorbutton.h>
#include
<kmessagebox.h>
#include
<KColorButton>
#include
<KMessageBox>
#include
<QRadioButton>
#include
<QTimer>
...
...
kmplot/kconstanteditor.cpp
View file @
551b41c7
...
...
@@ -29,16 +29,13 @@
#include
"xparser.h"
#include
<QDebug>
#include
<kinputdialog.h>
#include
<kmessagebox.h>
#include
<kstandarddirs.h>
#include
<qdom.h>
#include
<QDialogButtonBox>
#include
<QStandardPaths>
#include
<QTimer>
#include
<assert.h>
#include
<KConfigGroup>
#include
<
QDialogButton
Box>
#include
<
KMessage
Box>
#include
"ui_constantseditor.h"
...
...
kmplot/kmplot.cpp
View file @
551b41c7
...
...
@@ -24,24 +24,26 @@
#include
"kmplot.h"
#include
<kconfig.h>
#include
<kconfiggroup.h>
#include
<kedittoolbar.h>
#include
<kshortcutsdialog.h>
#include
<klibloader.h>
#include
<kmessagebox.h>
#include
<kmplotprogress.h>
#include
<kstatusbar.h>
#include
<kstandardaction.h>
#include
<kurl.h>
#include
<kactioncollection.h>
#include
"maindlg.h"
#include
<ktoolinvocation.h>
#include
<ktogglefullscreenaction.h>
#include
<KConfigGroup>
#include
<QFileDialog>
#include
<QLabel>
#include
<QStatusBar>
#include
<QUrl>
#include
<KActionCollection>
#include
<KConfig>
#include
<KConfigGroup>
#include
<KLocalizedString>
#include
<KMessageBox>
#include
<KPluginLoader>
#include
<KShortcutsDialog>
#include
<KStandardAction>
#include
<KToggleFullScreenAction>
#include
<KToolInvocation>
#include
"maindlg.h"
#include
<kmplotprogress.h>
#include
"kmplotadaptor.h"
#include
"view.h"
static
QUrl
urlFromArg
(
const
QString
&
arg
)
{
...
...
@@ -246,22 +248,31 @@ bool KmPlot::queryClose()
void
KmPlot
::
setStatusBarText
(
const
QString
&
text
,
int
id
)
{
static_cast
<
KStatusBar
*>
(
statusBar
())
->
changeItem
(
text
,
id
);
static_cast
<
QLabel
*>
(
statusBar
Labels
.
at
(
id
))
->
setText
(
text
);
}
void
KmPlot
::
setupStatusBar
()
{
K
StatusBar
*
statusBar
=
new
K
StatusBar
(
this
);
Q
StatusBar
*
statusBar
=
new
Q
StatusBar
(
this
);
setStatusBar
(
statusBar
);
statusBar
->
insertFixedItem
(
"1234567890123456"
,
1
);
statusBar
->
insertFixedItem
(
"1234567890123456"
,
2
);
statusBar
->
insertItem
(
""
,
3
,
3
);
statusBar
->
insertItem
(
""
,
4
);
statusBar
->
changeItem
(
""
,
1
);
statusBar
->
changeItem
(
""
,
2
);
statusBar
->
setItemAlignment
(
3
,
Qt
::
AlignLeft
);
for
(
int
i
=
0
;
i
<
View
::
SectionCount
;
++
i
)
{
QLabel
*
label
=
new
QLabel
(
statusBar
);
label
->
setFixedHeight
(
label
->
fontMetrics
().
height
()
+
2
);
/// Labels for coordinates should be of fixed width 16 chars to be the same as for good old KmPlot
if
(
i
<
2
)
{
label
->
setFixedWidth
(
label
->
fontMetrics
().
width
(
QLatin1Char
(
'8'
))
*
16
);
label
->
setAlignment
(
Qt
::
AlignCenter
);
}
else
{
label
->
setAlignment
(
Qt
::
AlignLeft
);
}
statusBar
->
addWidget
(
label
);
statusBarLabels
.
append
(
label
);
}
m_progressBar
=
new
KmPlotProgress
(
statusBar
);
m_progressBar
->
setMaximumHeight
(
statusBar
->
height
()
-
10
);
...
...
kmplot/kmplot.h
View file @
551b41c7
...
...
@@ -29,6 +29,7 @@
#include
<kparts/readwritepart.h>
class
QCommandLineParser
;
class
QLabel
;
class
KmPlotProgress
;
class
KToggleFullScreenAction
;
...
...
@@ -104,6 +105,8 @@ private:
KToggleFullScreenAction
*
m_fullScreen
;
/// The progress bar for drawing functions
KmPlotProgress
*
m_progressBar
;
/// The labels set to show information on the statusbar
QList
<
QLabel
*>
statusBarLabels
;
};
#endif // KMPLOT_H_
kmplot/kmplotio.h
View file @
551b41c7
...
...
@@ -25,7 +25,7 @@
#ifndef KMPLOTIO_H
#define KMPLOTIO_H
#include
<
kurl.h
>
#include
<
QUrl
>
#include
<QGradient>
class
Equation
;
...
...
kmplot/kparametereditor.cpp
View file @
551b41c7
...
...
@@ -37,7 +37,6 @@
#include
<QVBoxLayout>
#include
<KConfigGroup>
#include
<KIO/StoredTransferJob>
#include
<KInputDialog>
#include
<KJobWidgets>
#include
<KMessageBox>
...
...
kmplot/maindlg.cpp
View file @
551b41c7
...
...
@@ -37,29 +37,23 @@
#include
<QPixmap>
#include
<QPrintDialog>
#include
<QPrinter>
#include
<QStandardPaths>
#include
<QSvgGenerator>
#include
<QTemporaryFile>
#include
<QTimer>
// KDE includes
#include
<
k4aboutdata.h
>
#include
<
kc
onfig
d
ialog
.h
>
#include
<
kc
onfig
d
ialog
m
anager
.h
>
#include
<
kedittoolbar.h
>
#include
<
KActionCollection
>
#include
<
KC
onfig
D
ialog>
#include
<
KC
onfig
D
ialog
M
anager>
#include
<
KHelpClient
>
#include
<KIO/StatJob>
#include
<kcomponentdata.h>
#include
<klineedit.h>
#include
<kmessagebox.h>
#include
<kstandarddirs.h>
#include
<kstandardaction.h>
#include
<ktoolbar.h>
#include
<ktoolinvocation.h>
#include
<krecentfilesaction.h>
#include
<kactioncollection.h>
#include
<khelpclient.h>
#include
<kiconloader.h>
#include
<kapplication.h>
#include
<KIO/StoredTransferJob>
#include
<KLineEdit>
#include
<KMessageBox>
#include
<KStandardAction>
#include
<KToolBar>
#include
<KToolInvocation>
// local includes
#include
"calculator.h"
...
...
kmplot/maindlg.h
View file @
551b41c7
...
...
@@ -30,16 +30,16 @@
// Qt includes
#include
<QDomDocument>
#include
<QStack>
#include
<QMenu>
#include
<QStack>
#include
<QStandardPaths>
// KDE includes
#include
<ksharedconfig.h>
#include
<kstandarddirs.h>
#include
<kparts/browserextension.h>
#include
<kparts/part.h>
#include
<kparts/readwritepart.h>
#include
<kparts/factory.h>
#include
<KSharedConfig>
#include
<KParts/BrowserExtension>
#include
<KParts/Part>
#include
<KParts/ReadWritePart>
#include
<KPluginFactory>
#undef GrayScale
...
...
kmplot/view.cpp
View file @
551b41c7
...
...
@@ -29,30 +29,27 @@
// Qt includes
#include
<QAbstractTextDocumentLayout>
#include
<qbitmap.h>
#include
<qcursor.h>
#include
<qdatastream.h>
#include
<QPainter>
#include
<qslider.h>
#include
<qtimer.h>
#include
<QPixmap>
#include
<QPaintEvent>
#include
<QKeyEvent>
#include
<QBitmap>
#include
<QCursor>
#include
<QDataStream>
#include
<QDebug>
#include
<QEvent>
#include
<QKeyEvent>
#include
<QList>
#include
<QMenu>
#include
<QMouseEvent>
#include
<QPaintEvent>
#include
<QPainter>
#include
<QPixmap>
#include
<QResizeEvent>
#include
<QSlider>
#include
<QTextEdit>
#include
<QTime>
#include
<QMenu>
#include
<QMouseEvent>
#include
<QTimer>
// KDE includes
#include
<kaction.h>
#include
<kactioncollection.h>
#include
<QDebug>
#include
<kiconloader.h>
#include
<kmessagebox.h>
#include
<kmenu.h>
#include
<KActionCollection>
#include
<KMessageBox>
// local includes
#include
"functioneditor.h"
...
...
kmplot/view.h
View file @
551b41c7
...
...
@@ -192,6 +192,18 @@ class View : public QWidget
void
setPrintBackground
(
bool
status
);
void
setPrintWidth
(
double
width
);
void
setPrintHeight
(
double
height
);
/**
* Which part of the status bar.
*/
enum
StatusBarSection
{
XSection
=
0
,
YSection
=
1
,
RootSection
=
2
,
FunctionSection
=
3
,
SectionCount
=
4
};
public
slots
:
/// Called when the user want to cancel the drawing
...
...
@@ -387,16 +399,6 @@ class View : public QWidget
* [min,max].
*/
QList
<
double
>
findRoots
(
const
Plot
&
plot
,
double
min
,
double
max
,
RootAccuracy
accuracy
);
/**
* Which part of the status bar.
*/
enum
StatusBarSection
{
XSection
=
1
,
YSection
=
2
,
RootSection
=
3
,
FunctionSection
=
4
};
/**
* Changes the text in the statusbar.
*/
...
...
kmplot/xparser.cpp
View file @
551b41c7
...
...
@@ -32,9 +32,8 @@
#include
"maindlg.h"
// KDE includes
#include
<kinputdialog.h>
#include
<KLocalizedString>
#include
<
km
essage
b
ox
.h
>
#include
<
KM
essage
B
ox>
#include
<QList>
#include
<QDebug>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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