Boilerplate and repeated code in GUI
The following discussions from !173 (merged) should be addressed:
These comments pertain to the amount of boilerplate and repeated code in DetectorWindow
but is characteristic of most of the GUI code, and will be postponed to a comprehensive round of refactoring.
-
@j.wuttke started a discussion: up to you: would it be appropriate to have functions, or lambdas,
createLabelLeft
,createLabelRight
, so that you can merge 3 lines (plus 1 blank line) into one:addWidget(createLabelLeft("Colour"), 13, 0, 1, 1);
-
@j.wuttke started a discussion: Should something be done about the amount of boilerplate code above? Use std::array<2,..> or just C-arrays of size 2 for all these members? Use an iterator over all these pointers to do
setMaximumWidth
andsetSizePolicy
at once?We may also postpone this discussion to some later clean-up round.