Skip to content

Commit

Permalink
Add overloads without parent for ctors with default parent param at t…
Browse files Browse the repository at this point in the history
…he end.
  • Loading branch information
przemek83 committed Jan 13, 2025
1 parent 8cee2d6 commit a30dcdd
Show file tree
Hide file tree
Showing 18 changed files with 54 additions and 11 deletions.
3 changes: 2 additions & 1 deletion include/wble/Filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ class WBLE_EXPORT Filter : public QGroupBox
{
Q_OBJECT
public:
explicit Filter(const QString& title, QWidget* parent = nullptr);
Filter(const QString& title, QWidget* parent);
explicit Filter(const QString& title);

public Q_SLOTS:
void setChecked(bool checked);
Expand Down
4 changes: 3 additions & 1 deletion include/wble/FilterDates.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ class WBLE_EXPORT FilterDates : public Filter
Q_OBJECT
public:
FilterDates(const QString& name, QDate fromDate, QDate toDate,
bool emptyDates, QWidget* parent = nullptr);
bool emptyDates, QWidget* parent);
FilterDates(const QString& name, QDate fromDate, QDate toDate,
bool emptyDates);

~FilterDates() override;

Expand Down
4 changes: 2 additions & 2 deletions include/wble/FilterDoubles.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class WBLE_EXPORT FilterDoubles : public FilterNumbers
{
Q_OBJECT
public:
FilterDoubles(const QString& name, double from, double to,
QWidget* parent = nullptr);
FilterDoubles(const QString& name, double from, double to, QWidget* parent);
FilterDoubles(const QString& name, double from, double to);

Q_SIGNALS:
/// Emitted when filter state was changed.
Expand Down
3 changes: 2 additions & 1 deletion include/wble/FilterIntegers.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ class WBLE_EXPORT FilterIntegers : public FilterNumbers
Q_OBJECT
public:
FilterIntegers(const QString& name, double from, double to,
QWidget* parent = nullptr);
QWidget* parent);
FilterIntegers(const QString& name, double from, double to);

Q_SIGNALS:
/// Emitted when filter state was changed.
Expand Down
3 changes: 2 additions & 1 deletion include/wble/FilterStrings.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ class WBLE_EXPORT FilterStrings : public Filter
Q_OBJECT
public:
FilterStrings(const QString& name, QStringList initialList,
QWidget* parent = nullptr);
QWidget* parent);
FilterStrings(const QString& name, QStringList initialList);

~FilterStrings() override;

Expand Down
3 changes: 2 additions & 1 deletion include/wble/ProgressBar.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class WBLE_EXPORT ProgressBar : public QWidget
/// Constructor of ProgressBar class.
/// @param title Title to be shown.
/// @param parent Parent widget.
explicit ProgressBar(QString title, QWidget* parent = nullptr);
ProgressBar(QString title, QWidget* parent);
explicit ProgressBar(QString title);

virtual void start();

Expand Down
3 changes: 2 additions & 1 deletion include/wble/ProgressBarCounter.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ class WBLE_EXPORT ProgressBarCounter : public ProgressBar
/// @param title Title to be shown.
/// @param maxValue Maximum value after hitting which 100% is achieved..
/// @param parent Parent widget.
ProgressBarCounter(QString title, int maxValue, QWidget* parent = nullptr);
ProgressBarCounter(QString title, int maxValue, QWidget* parent);
ProgressBarCounter(QString title, int maxValue);

void reset() override;

Expand Down
3 changes: 2 additions & 1 deletion include/wble/ProgressBarInfinite.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ class WBLE_EXPORT ProgressBarInfinite : public ProgressBar
/// Constructor of ProgressBarCounter class.
/// @param title Title to be shown.
/// @param parent Parent widget.
explicit ProgressBarInfinite(QString title, QWidget* parent = nullptr);
ProgressBarInfinite(QString title, QWidget* parent);
explicit ProgressBarInfinite(QString title);

void start() override;

Expand Down
2 changes: 1 addition & 1 deletion src/DoubleClickEater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <QEvent>

DoubleClickEater::DoubleClickEater(QObject* parent) : QObject(parent) {}
DoubleClickEater::DoubleClickEater() : QObject(nullptr) {}

bool DoubleClickEater::eventFilter(QObject* watched, QEvent* event)
{
Expand Down
2 changes: 1 addition & 1 deletion src/DoubleClickEater.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class DoubleClickEater : public QObject
{
Q_OBJECT
public:
explicit DoubleClickEater(QObject* parent = nullptr);
DoubleClickEater();

protected:
bool eventFilter(QObject* watched, QEvent* event) override;
Expand Down
2 changes: 2 additions & 0 deletions src/Filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Filter::Filter(const QString& title, QWidget* parent) : QGroupBox(title, parent)
connect(this, &Filter::toggled, this, &Filter::setChecked);
}

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

void Filter::setChecked(bool checked)
{
QGroupBox::setChecked(checked);
Expand Down
6 changes: 6 additions & 0 deletions src/FilterDates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ FilterDates::FilterDates(const QString& name, QDate fromDate, QDate toDate,
ui_->ignoreEmptyDates->setEnabled(emptyDates_);
}

FilterDates::FilterDates(const QString& name, QDate fromDate, QDate toDate,
bool emptyDates)
: FilterDates(name, fromDate, toDate, emptyDates, nullptr)
{
}

FilterDates::~FilterDates() = default;

void FilterDates::initFromDateCalendar()
Expand Down
5 changes: 5 additions & 0 deletions src/FilterDoubles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ FilterDoubles::FilterDoubles(const QString& name, double from, double to,
QLocale::system().toString(to, 'f', getDecimalPlaces()));
}

FilterDoubles::FilterDoubles(const QString& name, double from, double to)
: FilterDoubles(name, from, to, nullptr)
{
}

bool FilterDoubles::isDoubleMode() const { return true; }

void FilterDoubles::emitChangeSignal()
Expand Down
5 changes: 5 additions & 0 deletions src/FilterIntegers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ FilterIntegers::FilterIntegers(const QString& name, double from, double to,
toLineEdit->setText(QLocale::system().toString(toInt));
}

FilterIntegers::FilterIntegers(const QString& name, double from, double to)
: FilterIntegers(name, from, to, nullptr)
{
}

bool FilterIntegers::isDoubleMode() const { return false; }

void FilterIntegers::emitChangeSignal()
Expand Down
5 changes: 5 additions & 0 deletions src/FilterStrings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ FilterStrings::FilterStrings(const QString& name, QStringList initialList,
}
}

FilterStrings::FilterStrings(const QString& name, QStringList initialList)
: FilterStrings(name, initialList, nullptr)
{
}

FilterStrings::~FilterStrings() = default;

void FilterStrings::itemChecked(const QListWidgetItem* item)
Expand Down
2 changes: 2 additions & 0 deletions src/ProgressBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ ProgressBar::ProgressBar(QString title, QWidget* parent)
initTitleRectangle();
}

ProgressBar::ProgressBar(QString title) : ProgressBar(title, nullptr) {}

void ProgressBar::start() { running_ = true; }

void ProgressBar::stop() { running_ = false; }
Expand Down
5 changes: 5 additions & 0 deletions src/ProgressBarCounter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ ProgressBarCounter::ProgressBarCounter(QString title, int maxValue,
{
}

ProgressBarCounter::ProgressBarCounter(QString title, int maxValue)
: ProgressBarCounter(title, maxValue, nullptr)
{
}

void ProgressBarCounter::reset()
{
currentPercent_ = 0;
Expand Down
5 changes: 5 additions & 0 deletions src/ProgressBarInfinite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ ProgressBarInfinite::ProgressBarInfinite(QString title, QWidget* parent)
{
}

ProgressBarInfinite::ProgressBarInfinite(QString title)
: ProgressBarInfinite(title, nullptr)
{
}

void ProgressBarInfinite::start()
{
timerId_ = startTimer(TIMER_DEFAULT_INTERVAL);
Expand Down

0 comments on commit a30dcdd

Please sign in to comment.