cleanup: turn protected into private members

Some profilewidget classes hat protected members which can
be made private as there is no subclassing.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-04-13 19:41:30 +02:00 committed by Dirk Hohndel
parent fc697538fa
commit ebb342c969
4 changed files with 8 additions and 14 deletions

View file

@ -81,7 +81,7 @@ class DepthAxis : public DiveCartesianAxis {
Q_OBJECT Q_OBJECT
public: public:
DepthAxis(ProfileWidget2 *widget); DepthAxis(ProfileWidget2 *widget);
protected: private:
QString textForValue(double value); QString textForValue(double value);
QColor colorForValue(double value); QColor colorForValue(double value);
private private
@ -94,8 +94,7 @@ class TimeAxis : public DiveCartesianAxis {
public: public:
TimeAxis(ProfileWidget2 *widget); TimeAxis(ProfileWidget2 *widget);
void updateTicks(color_index_t color = TIME_GRID); void updateTicks(color_index_t color = TIME_GRID);
private:
protected:
QString textForValue(double value); QString textForValue(double value);
QColor colorForValue(double value); QColor colorForValue(double value);
}; };
@ -104,7 +103,7 @@ class TemperatureAxis : public DiveCartesianAxis {
Q_OBJECT Q_OBJECT
public: public:
TemperatureAxis(ProfileWidget2 *widget); TemperatureAxis(ProfileWidget2 *widget);
protected: private:
QString textForValue(double value); QString textForValue(double value);
}; };
@ -116,7 +115,6 @@ public:
public public
slots: slots:
void settingsChanged(); void settingsChanged();
private: private:
DivePlotDataModel *model; DivePlotDataModel *model;
}; };

View file

@ -19,11 +19,11 @@ class CloseButtonItem : public DivePixmapItem {
Q_OBJECT Q_OBJECT
public: public:
CloseButtonItem(QGraphicsItem *parent = 0); CloseButtonItem(QGraphicsItem *parent = 0);
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
public slots: public slots:
void hide(); void hide();
void show(); void show();
private:
void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
}; };
class DivePictureItem : public DivePixmapItem { class DivePictureItem : public DivePixmapItem {
@ -37,11 +37,10 @@ public slots:
void settingsChanged(); void settingsChanged();
void removePicture(); void removePicture();
void setFileUrl(const QString& s); void setFileUrl(const QString& s);
protected: private:
void hoverEnterEvent(QGraphicsSceneHoverEvent *event); void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
void mousePressEvent(QGraphicsSceneMouseEvent *event); void mousePressEvent(QGraphicsSceneMouseEvent *event);
private:
QString fileUrl; QString fileUrl;
QGraphicsRectItem *canvas; QGraphicsRectItem *canvas;
QGraphicsRectItem *shadow; QGraphicsRectItem *shadow;

View file

@ -183,10 +183,8 @@ public
slots: slots:
void recalc(); void recalc();
protected:
ProfileWidget2 *profileWidget;
private: private:
ProfileWidget2 *profileWidget;
bool is3mIncrement; bool is3mIncrement;
}; };

View file

@ -21,9 +21,8 @@ public:
void setPlotInfo(const struct plot_info &info); void setPlotInfo(const struct plot_info &info);
void recalculate(); void recalculate();
protected:
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
private: private:
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
struct plot_info pInfo; struct plot_info pInfo;
int idx; int idx;
RulerItem2 *ruler; RulerItem2 *ruler;