Skip to content

Commit

Permalink
Clean Sonar issues related to comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
przemek83 committed Jan 13, 2025
1 parent 9368347 commit 54cf4b6
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 111 deletions.
7 changes: 3 additions & 4 deletions include/wble/Filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

#include "wble_global.h"

/**
* @class Filter
* @brief Filters base class.
*/
/// @class Filter
/// @brief Filters base class.

class WBLE_EXPORT Filter : public QGroupBox
{
Q_OBJECT
Expand Down
30 changes: 11 additions & 19 deletions include/wble/FilterDates.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ namespace Ui
class FilterDates;
} // namespace Ui

/**
* @class FilterDates
* @brief Filter for date type.
*/
/// @class FilterDates
/// @brief Filter for date type.
class WBLE_EXPORT FilterDates : public Filter
{
Q_OBJECT
Expand All @@ -27,13 +25,11 @@ class WBLE_EXPORT FilterDates : public Filter
~FilterDates() override;

Q_SIGNALS:
/**
* Emitted when filter state was changed.
* @param fromDate Current from date.
* @param toDate Current to date.
* @param filterEmptyDates Flag indicating that data with empty date should
* be ignored.
*/
/// Emitted when filter state was changed.
/// @param fromDate Current from date.
/// @param toDate Current to date.
/// @param filterEmptyDates Flag indicating that data with empty date should
/// be ignored.
void newDateFilter(QDate fromDate, QDate toDate, bool filterEmptyDates);

protected:
Expand All @@ -60,15 +56,11 @@ class WBLE_EXPORT FilterDates : public Filter
const bool emptyDates_;

private Q_SLOTS:
/**
* Triggered on change of date in from date edit.
* @param newDate New value.
*/
/// Triggered on change of date in from date edit.
/// @param newDate New value.
void fromDateChanged(QDate newDate);

/**
* Triggered on change of date in to date edit.
* @param newDate New value.
*/
/// Triggered on change of date in to date edit.
/// @param newDate New value.
void toDateChanged(QDate newDate);
};
14 changes: 5 additions & 9 deletions include/wble/FilterDoubles.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@

#include "FilterNumbers.h"

/**
* @class FilterDoubles
* @brief Numeric filter for double values.
*/
/// @class FilterDoubles
/// @brief Numeric filter for double values.
class WBLE_EXPORT FilterDoubles : public FilterNumbers
{
Q_OBJECT
Expand All @@ -16,11 +14,9 @@ class WBLE_EXPORT FilterDoubles : public FilterNumbers
QWidget* parent = nullptr);

Q_SIGNALS:
/**
* Emitted when filter state was changed.
* @param from Current value of from number.
* @param to Current value of to number.
*/
/// Emitted when filter state was changed.
/// @param from Current value of from number.
/// @param to Current value of to number.
void newNumericFilter(double from, double to);

protected:
Expand Down
14 changes: 5 additions & 9 deletions include/wble/FilterIntegers.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@

#include "FilterNumbers.h"

/**
* @class FilterIntegers
* @brief Numeric filter for integer values.
*/
/// @class FilterIntegers
/// @brief Numeric filter for integer values.
class WBLE_EXPORT FilterIntegers : public FilterNumbers
{
Q_OBJECT
Expand All @@ -16,11 +14,9 @@ class WBLE_EXPORT FilterIntegers : public FilterNumbers
QWidget* parent = nullptr);

Q_SIGNALS:
/**
* Emitted when filter state was changed.
* @param from Current value of from number.
* @param to Current value of to number.
*/
/// Emitted when filter state was changed.
/// @param from Current value of from number.
/// @param to Current value of to number.
void newNumericFilter(int from, int to);

protected:
Expand Down
26 changes: 8 additions & 18 deletions include/wble/FilterNumbers.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ class FilterNumbers;

class QLineEdit;

/**
* @class FilterNumbers
* @brief Base class for numeric filters.
*/
/// @class FilterNumbers
/// @brief Base class for numeric filters.
class WBLE_EXPORT FilterNumbers : public Filter
{
Q_OBJECT
Expand Down Expand Up @@ -67,26 +65,18 @@ class WBLE_EXPORT FilterNumbers : public Filter
const int decimalPlaces_{2};

private Q_SLOTS:
/**
* Triggered on change of left handle on slider.
* @param newValue new value.
*/
/// Triggered on change of left handle on slider.
/// @param newValue new value.
void sliderFromChanged(double newValue);

/**
* Triggered on change of right handle on slider.
* @param newValue new value.
*/
/// Triggered on change of right handle on slider.
/// @param newValue new value.
void sliderToChanged(double newValue);

/**
* Triggered on change of left LineEdit (from).
*/
/// Triggered on change of left LineEdit (from).
void fromEditingFinished();

/**
* Triggered on change of right LineEdit (to).
*/
/// Triggered on change of right LineEdit (to).
void toEditingFinished();

void lineEditContentModified(const QString& currentContent) const;
Expand Down
24 changes: 8 additions & 16 deletions include/wble/FilterStrings.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ namespace Ui
class FilterStrings;
} // namespace Ui

/**
* @class FilterNames
* @brief Names filter for strings.
*/
/// @class FilterNames
/// @brief Names filter for strings.
class WBLE_EXPORT FilterStrings : public Filter
{
Q_OBJECT
Expand All @@ -31,10 +29,8 @@ class WBLE_EXPORT FilterStrings : public Filter
QSize sizeHint() const override;

Q_SIGNALS:
/**
* Emitted when filter state was changed.
* @param bannedList List of unchecked items.
*/
/// Emitted when filter state was changed.
/// @param bannedList List of unchecked items.
void newStringFilter(QStringList bannedList);

protected:
Expand Down Expand Up @@ -67,15 +63,11 @@ class WBLE_EXPORT FilterStrings : public Filter
std::unique_ptr<DoubleClickEater> doubleClickEater_;

private Q_SLOTS:
/**
* Triggered when user click on item.
* @param item Item clicked.
*/
/// Triggered when user click on item.
/// @param item Item clicked.
void itemChecked(const QListWidgetItem* item);

/**
* Triggered when user click on select all checkbox.
* @param checked Checked state.
*/
/// Triggered when user click on select all checkbox.
/// @param checked Checked state.
void selectAllToggled(bool checked);
};
20 changes: 7 additions & 13 deletions include/wble/ProgressBar.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,15 @@

#include "wble_global.h"

/**
* @class ProgressBar
* @brief Round progress bar to visualize task progress.
*/
/// @class ProgressBar
/// @brief Round progress bar to visualize task progress.
class WBLE_EXPORT ProgressBar : public QWidget
{
Q_OBJECT
public:
/**
* Constructor of ProgressBar class.
* @param title Title to be shown.
* @param parent Parent widget.
*/
/// Constructor of ProgressBar class.
/// @param title Title to be shown.
/// @param parent Parent widget.
explicit ProgressBar(QString title, QWidget* parent = nullptr);

virtual void start();
Expand All @@ -40,10 +36,8 @@ class WBLE_EXPORT ProgressBar : public QWidget

void initPainter(QPainter* painter) const override;

/**
* Paint graphically progress bar arc.
* @param painter Painter which should be used.
*/
/// Paint graphically progress bar arc.
/// @param painter Painter which should be used.
virtual void paintProgressBar(QPainter& painter) = 0;

QRect getArcRectangle() const;
Expand Down
22 changes: 8 additions & 14 deletions include/wble/ProgressBarCounter.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,23 @@

#include "ProgressBar.h"

/**
* @class ProgressBarCounter
* @brief Round progress bar with percent counter.
*/
/// @class ProgressBarCounter
/// @brief Round progress bar with percent counter.
class WBLE_EXPORT ProgressBarCounter : public ProgressBar
{
Q_OBJECT
public:
/**
* Constructor of ProgressBarCounter class.
* @param title Title to be shown.
* @param maxValue Maximum value after hitting which 100% is achieved..
* @param parent Parent widget.
*/
/// Constructor of ProgressBarCounter class.
/// @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);

void reset() override;

public Q_SLOTS:
/**
* Update progress with new value.
* @param newValue New value for drawing progress: % = newValue / maxValue_.
*/
/// Update progress with new value.
/// @param newValue New value for drawing progress: % = newValue/maxValue_.
void updateProgress(int newValue);

protected:
Expand Down
14 changes: 5 additions & 9 deletions include/wble/ProgressBarInfinite.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@

#include "ProgressBar.h"

/**
* @class ProgressBarInfinite
* @brief Round progress showing two arcs moving infinitely.
*/
/// @class ProgressBarInfinite
/// @brief Round progress showing two arcs moving infinitely.
class WBLE_EXPORT ProgressBarInfinite : public ProgressBar
{
Q_OBJECT
public:
/**
* Constructor of ProgressBarCounter class.
* @param title Title to be shown.
* @param parent Parent widget.
*/
/// Constructor of ProgressBarCounter class.
/// @param title Title to be shown.
/// @param parent Parent widget.
explicit ProgressBarInfinite(QString title, QWidget* parent = nullptr);

void start() override;
Expand Down

0 comments on commit 54cf4b6

Please sign in to comment.