Skip to content

Commit

Permalink
Move some values initializations to named fields in Examples class.
Browse files Browse the repository at this point in the history
  • Loading branch information
przemek83 committed Dec 26, 2024
1 parent 41b087d commit ec32897
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 2 additions & 5 deletions examples/Examples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ Examples::Examples()
doubleSlider_{MIN, MAX},
filterIntegers_{QStringLiteral("Integers Filter"), MIN, MAX},
filterDoubles_{QStringLiteral("Doubles Filter"), MIN, MAX},
filterDates_{QStringLiteral("Dates Filter"), QDate(2010, 9, 21),
QDate(2012, 2, 25), true},
filterStrings_{QStringLiteral("Names Filter"),
QStringList{QStringLiteral("a"), QStringLiteral("b"),
QStringLiteral("c"), QStringLiteral("d")}}
filterDates_{QStringLiteral("Dates Filter"), startDate_, endDate_, true},
filterStrings_{QStringLiteral("Names Filter"), exampleStringsList_}
{
setWindowTitle("Wble library examples");
QHBoxLayout* widgetLayout{new QHBoxLayout(this)};
Expand Down
7 changes: 7 additions & 0 deletions examples/Examples.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ class Examples : public QWidget

QLabel info_;

const QDate startDate_{2010, 9, 21};
const QDate endDate_{2012, 2, 25};

const QStringList exampleStringsList_{
QStringLiteral("a"), QStringLiteral("b"), QStringLiteral("c"),
QStringLiteral("d")};

DoubleSlider doubleSlider_;
FilterIntegers filterIntegers_;
FilterDoubles filterDoubles_;
Expand Down

0 comments on commit ec32897

Please sign in to comment.