Skip to content

Commit

Permalink
Refactor constructors to remove default nullptr parent parameter and …
Browse files Browse the repository at this point in the history
…add overloads.
  • Loading branch information
przemek83 committed Jan 14, 2025
1 parent c5f5761 commit 1cf337b
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 8 deletions.
3 changes: 2 additions & 1 deletion include/qwtble/BasicDataPlot.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class QWTBLE_EXPORT BasicDataPlot : public PlotBase
{
Q_OBJECT
public:
explicit BasicDataPlot(QWidget* parent = nullptr);
explicit BasicDataPlot(QWidget* parent);
BasicDataPlot();

~BasicDataPlot() override;

Expand Down
3 changes: 2 additions & 1 deletion include/qwtble/GroupPlot.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class QWTBLE_EXPORT GroupPlot : public PlotBase
{
Q_OBJECT
public:
explicit GroupPlot(QWidget* parent = nullptr);
explicit GroupPlot(QWidget* parent);
GroupPlot();

~GroupPlot() override;

Expand Down
6 changes: 4 additions & 2 deletions include/qwtble/GroupPlotUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ class QWTBLE_EXPORT GroupPlotUI : public QWidget
{
Q_OBJECT
public:
explicit GroupPlotUI(const QVector<std::pair<QString, int> >& stringColumns,
QWidget* parent = nullptr);
GroupPlotUI(const QVector<std::pair<QString, int> >& stringColumns,
QWidget* parent);
explicit GroupPlotUI(
const QVector<std::pair<QString, int> >& stringColumns);

~GroupPlotUI() override;

Expand Down
3 changes: 2 additions & 1 deletion include/qwtble/HistogramPlot.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class QWTBLE_EXPORT HistogramPlot : public PlotBase
{
Q_OBJECT
public:
explicit HistogramPlot(QWidget* parent = nullptr);
explicit HistogramPlot(QWidget* parent);
HistogramPlot();

~HistogramPlot() override;

Expand Down
3 changes: 2 additions & 1 deletion include/qwtble/HistogramPlotUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class QWTBLE_EXPORT HistogramPlotUI : public QWidget
{
Q_OBJECT
public:
explicit HistogramPlotUI(QWidget* parent = nullptr);
explicit HistogramPlotUI(QWidget* parent);
HistogramPlotUI();

~HistogramPlotUI() override;

Expand Down
3 changes: 2 additions & 1 deletion include/qwtble/PlotBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class QWTBLE_EXPORT PlotBase : public QwtPlot
{
Q_OBJECT
public:
explicit PlotBase(const QString& title, QWidget* parent = nullptr);
PlotBase(const QString& title, QWidget* parent);
explicit PlotBase(const QString& title);

~PlotBase() override;

Expand Down
3 changes: 2 additions & 1 deletion include/qwtble/QuantilesPlot.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class QWTBLE_EXPORT QuantilesPlot : public PlotBase
{
Q_OBJECT
public:
explicit QuantilesPlot(QWidget* parent = nullptr);
explicit QuantilesPlot(QWidget* parent);
QuantilesPlot();

~QuantilesPlot() override;

Expand Down
2 changes: 2 additions & 0 deletions src/BasicDataPlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ BasicDataPlot::BasicDataPlot(QWidget* parent)
checkLegendItems();
}

BasicDataPlot::BasicDataPlot() : BasicDataPlot(nullptr) {}

BasicDataPlot::~BasicDataPlot() = default;

void BasicDataPlot::initPlotCurve()
Expand Down
2 changes: 2 additions & 0 deletions src/GroupPlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ GroupPlot::GroupPlot(QWidget* parent)
setAxisFont(QwtPlot::xBottom, font);
}

GroupPlot::GroupPlot() : GroupPlot(nullptr) {}

// Uncommon construction to allow forward declaration of YAxisNumberPicker.
GroupPlot::~GroupPlot() = default;

Expand Down
5 changes: 5 additions & 0 deletions src/GroupPlotUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ GroupPlotUI::GroupPlotUI(const QVector<std::pair<QString, int> >& stringColumns,
&GroupPlotUI::updateQuantilesPlotExtent);
}

GroupPlotUI::GroupPlotUI(const QVector<std::pair<QString, int> >& stringColumns)
: GroupPlotUI(stringColumns, nullptr)
{
}

GroupPlotUI::~GroupPlotUI() = default;

void GroupPlotUI::setNewData(const QVector<QString>& intervalsNames,
Expand Down
2 changes: 2 additions & 0 deletions src/HistogramPlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ HistogramPlot::HistogramPlot(QWidget* parent)
initLegend();
}

HistogramPlot::HistogramPlot() : HistogramPlot(nullptr) {}

// Uncommon construction to allow forward declaration of XYAxisNumberPicker.
HistogramPlot::~HistogramPlot() = default;

Expand Down
2 changes: 2 additions & 0 deletions src/HistogramPlotUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ HistogramPlotUI::HistogramPlotUI(QWidget* parent)
&histogramPlot_, &HistogramPlot::recompute);
}

HistogramPlotUI::HistogramPlotUI() : HistogramPlotUI(nullptr) {}

HistogramPlotUI::~HistogramPlotUI() = default;

void HistogramPlotUI::setNewData(QVector<double> data,
Expand Down
2 changes: 2 additions & 0 deletions src/PlotBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ PlotBase::PlotBase(const QString& title, QWidget* parent)
setAxisLabelAlignment(QwtPlot::xBottom, Qt::AlignLeft | Qt::AlignBottom);
}

PlotBase::PlotBase(const QString& title) : PlotBase(title, nullptr) {}

// Uncommon construction to allow forward declaration of PlotMagnifier class.
PlotBase::~PlotBase() = default;

Expand Down
2 changes: 2 additions & 0 deletions src/QuantilesPlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ QuantilesPlot::QuantilesPlot(QWidget* parent)
setupLegend(width());
}

QuantilesPlot::QuantilesPlot() : QuantilesPlot(nullptr) {}

// Uncommon construction to allow forward declaration of YAxisNumberPicker.
QuantilesPlot::~QuantilesPlot() = default;

Expand Down

0 comments on commit 1cf337b

Please sign in to comment.