aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin ROBIN <dev@benjarobin.fr>2024-01-14 18:16:58 +0100
committerYordan Karadzhov <y.karadz@gmail.com>2024-01-20 12:50:55 +0200
commitfecb5f5ab8cbbefd0655721d7141344235a20ef7 (patch)
tree689414ab7777235036b8b1e7a8745fe389f14c16
parentb1141917992df603a5f6d8ba87eed1323dec59c7 (diff)
downloadkernel-shark-fecb5f5ab8cbbefd0655721d7141344235a20ef7.tar.gz
kernelshark: Keep overridden method protected instead of public
Also add "override" keyword when missing. Signed-off-by: Benjamin ROBIN <dev@benjarobin.fr> Signed-off-by: Yordan Karadzhov <y.karadz@gmail.com>
-rw-r--r--src/KsGLWidget.hpp41
-rw-r--r--src/KsModels.hpp9
-rw-r--r--src/KsPlotTools.hpp2
-rw-r--r--src/KsTraceViewer.hpp9
-rw-r--r--src/KsWidgetsLib.hpp9
5 files changed, 37 insertions, 33 deletions
diff --git a/src/KsGLWidget.hpp b/src/KsGLWidget.hpp
index 1c6253fe..cafc70bc 100644
--- a/src/KsGLWidget.hpp
+++ b/src/KsGLWidget.hpp
@@ -75,12 +75,6 @@ public:
~KsGLWidget();
- void initializeGL() override;
-
- void resizeGL(int w, int h) override;
-
- void paintGL() override;
-
void render();
void reset();
@@ -88,20 +82,6 @@ public:
/** Reprocess all graphs. */
void updateGeom() {resizeGL(width(), height());}
- void mousePressEvent(QMouseEvent *event);
-
- void mouseMoveEvent(QMouseEvent *event);
-
- void mouseReleaseEvent(QMouseEvent *event);
-
- void mouseDoubleClickEvent(QMouseEvent *event);
-
- void wheelEvent(QWheelEvent * event);
-
- void keyPressEvent(QKeyEvent *event);
-
- void keyReleaseEvent(QKeyEvent *event);
-
void loadData(KsDataStore *data, bool resetPlots);
void loadColors();
@@ -214,6 +194,27 @@ public:
/** Free the list of plugin-defined shapes. */
void freePluginShapes();
+protected:
+ void initializeGL() override;
+
+ void resizeGL(int w, int h) override;
+
+ void paintGL() override;
+
+ void mousePressEvent(QMouseEvent *event) override;
+
+ void mouseMoveEvent(QMouseEvent *event) override;
+
+ void mouseReleaseEvent(QMouseEvent *event) override;
+
+ void mouseDoubleClickEvent(QMouseEvent *event) override;
+
+ void wheelEvent(QWheelEvent * event) override;
+
+ void keyPressEvent(QKeyEvent *event) override;
+
+ void keyReleaseEvent(QKeyEvent *event) override;
+
signals:
/**
* This signal is emitted when the mouse moves over a visible
diff --git a/src/KsModels.hpp b/src/KsModels.hpp
index 2883ce32..e113cf5d 100644
--- a/src/KsModels.hpp
+++ b/src/KsModels.hpp
@@ -172,9 +172,6 @@ class KsFilterProxyModel : public QSortFilterProxyModel
public:
explicit KsFilterProxyModel(QObject *parent = nullptr);
- bool filterAcceptsRow(int sourceRow,
- const QModelIndex &sourceParent) const override;
-
void fill(KsDataStore *data);
void setSource(KsViewModel *s);
@@ -224,9 +221,13 @@ public:
/** A mutex used by the condition variable. */
std::mutex _mutex;
- /** A flag used to stop the serch for all threads. */
+ /** A flag used to stop the search for all threads. */
bool _searchStop;
+protected:
+ bool filterAcceptsRow(int sourceRow,
+ const QModelIndex &sourceParent) const override;
+
private:
int _searchProgress;
diff --git a/src/KsPlotTools.hpp b/src/KsPlotTools.hpp
index 68bd6f7a..8f53077a 100644
--- a/src/KsPlotTools.hpp
+++ b/src/KsPlotTools.hpp
@@ -662,7 +662,7 @@ private:
/** The vertical size (height) of the graphical element. */
int _height;
- void _draw(const Color &col, float size) const;
+ void _draw(const Color &col, float size) const override;
};
}; // KsPlot
diff --git a/src/KsTraceViewer.hpp b/src/KsTraceViewer.hpp
index 99e4d387..7cc57516 100644
--- a/src/KsTraceViewer.hpp
+++ b/src/KsTraceViewer.hpp
@@ -79,10 +79,6 @@ public:
void setTopRow(size_t r);
- void resizeEvent(QResizeEvent* event) override;
-
- void keyReleaseEvent(QKeyEvent *event);
-
void markSwitch();
void showRow(size_t r, bool mark);
@@ -101,6 +97,11 @@ public:
_model.loadColors();
}
+protected:
+ void resizeEvent(QResizeEvent* event) override;
+
+ void keyReleaseEvent(QKeyEvent *event) override;
+
signals:
/** Signal emitted when new row is selected. */
void select(size_t);
diff --git a/src/KsWidgetsLib.hpp b/src/KsWidgetsLib.hpp
index cc2dc998..e21441d7 100644
--- a/src/KsWidgetsLib.hpp
+++ b/src/KsWidgetsLib.hpp
@@ -261,20 +261,21 @@ public:
*/
int sd() const {return _sd;}
+ /** The user provided an input. The widget has been modified. */
+ bool _userInput;
+
+protected:
/**
* Reimplemented event handler used to update the geometry of the widget on
* resize events.
*/
- void resizeEvent(QResizeEvent* event)
+ void resizeEvent(QResizeEvent* event) override
{
KsUtils::setElidedText(&_streamLabel, _streamName,
Qt::ElideLeft, width());
QApplication::processEvents();
}
- /** The user provided an input. The widget has been modified. */
- bool _userInput;
-
protected:
QToolBar _tb;