Skip to content

Commit

Permalink
Move static functions to anonymous namespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
przemek83 committed Dec 25, 2024
1 parent 1872abf commit 5075be1
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions examples/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@
#include <wble/ProgressBarCounter.h>
#include <wble/ProgressBarInfinite.h>

static constexpr double MIN{3};
static constexpr double MAX{56};
namespace
{

constexpr double MIN{3};
constexpr double MAX{56};

static constexpr int MAX_PROGRESS_BAR_VALUE{100};
constexpr int MAX_PROGRESS_BAR_VALUE{100};

static DoubleSlider* createDoubleSlider(QLabel* infoLabel)
DoubleSlider* createDoubleSlider(QLabel* infoLabel)
{
auto* slider = new DoubleSlider(MIN, MAX);
QObject::connect(
Expand All @@ -38,7 +41,7 @@ static DoubleSlider* createDoubleSlider(QLabel* infoLabel)
return slider;
}

static FilterNumbers* createFilterIntegers(QLabel* infoLabel)
FilterNumbers* createFilterIntegers(QLabel* infoLabel)
{
auto* filterNumbers =
new FilterIntegers(QStringLiteral("Integers Filter"), MIN, MAX);
Expand All @@ -54,7 +57,7 @@ static FilterNumbers* createFilterIntegers(QLabel* infoLabel)
return filterNumbers;
}

static FilterNumbers* createFilterDoubles(QLabel* infoLabel)
FilterNumbers* createFilterDoubles(QLabel* infoLabel)
{
auto* filterNumbers =
new FilterDoubles(QStringLiteral("Doubles Filter"), MIN, MAX);
Expand All @@ -70,7 +73,7 @@ static FilterNumbers* createFilterDoubles(QLabel* infoLabel)
return filterNumbers;
}

static FilterDates* createFilterDates(QLabel* infoLabel)
FilterDates* createFilterDates(QLabel* infoLabel)
{
auto* filterDates =
new FilterDates(QStringLiteral("Dates Filter"), QDate(2010, 9, 21),
Expand All @@ -87,7 +90,7 @@ static FilterDates* createFilterDates(QLabel* infoLabel)
return filterDates;
}

static FilterStrings* createFilterStrings(QLabel* infoLabel)
FilterStrings* createFilterStrings(QLabel* infoLabel)
{
auto* filterNames = new FilterStrings(
QStringLiteral("Names Filter"),
Expand All @@ -102,7 +105,7 @@ static FilterStrings* createFilterStrings(QLabel* infoLabel)
return filterNames;
}

static QVBoxLayout* createLeftWidgetColumn(QLabel* infoLabel)
QVBoxLayout* createLeftWidgetColumn(QLabel* infoLabel)
{
auto* leftLayout = new QVBoxLayout();
leftLayout->setSpacing(10);
Expand All @@ -120,8 +123,8 @@ static QVBoxLayout* createLeftWidgetColumn(QLabel* infoLabel)
return leftLayout;
}

static QGroupBox* wrapProgressBar(const QString& name, ProgressBar* progressBar,
QPushButton* startStopButton)
QGroupBox* wrapProgressBar(const QString& name, ProgressBar* progressBar,
QPushButton* startStopButton)
{
auto* groupBox = new QGroupBox(name);
auto* layout = new QVBoxLayout();
Expand All @@ -131,7 +134,7 @@ static QGroupBox* wrapProgressBar(const QString& name, ProgressBar* progressBar,
return groupBox;
}

static QGroupBox* createProgressBarInfinite()
QGroupBox* createProgressBarInfinite()
{
auto* progressBar = new ProgressBarInfinite(QStringLiteral("Title"));
auto* startStopButton = new QPushButton(QStringLiteral("start"));
Expand All @@ -151,7 +154,7 @@ static QGroupBox* createProgressBarInfinite()
startStopButton);
}

static QGroupBox* createProgressBarCounter()
QGroupBox* createProgressBarCounter()
{
auto* progressBar =
new ProgressBarCounter(QStringLiteral("Title"), MAX_PROGRESS_BAR_VALUE);
Expand Down Expand Up @@ -193,7 +196,7 @@ static QGroupBox* createProgressBarCounter()
startStopButton);
}

static QVBoxLayout* createRightWidgetColumn()
QVBoxLayout* createRightWidgetColumn()
{
auto* rightLayout = new QVBoxLayout();
rightLayout->setSpacing(10);
Expand All @@ -203,6 +206,8 @@ static QVBoxLayout* createRightWidgetColumn()
return rightLayout;
}

} // namespace

int main(int argc, char* argv[])
{
QApplication a(argc, argv);
Expand Down

0 comments on commit 5075be1

Please sign in to comment.