4040#endif
4141#include < QtMath>
4242
43+ #include < common/FunctionsGui.h>
44+ #include < common/TypedefQtDeprecated.h>
4345#include < statistics/StatisticsData.h>
4446#include < statistics/StatisticsType.h>
45- #include < common/FunctionsGui.h>
4647
4748namespace stats
4849{
@@ -64,15 +65,18 @@ StatisticUIHandler::StatisticUIHandler()
6465 Qt::QueuedConnection);
6566}
6667
67- void StatisticUIHandler::setStatisticsData (StatisticsData *data) { this ->statisticsData = data; }
68+ void StatisticUIHandler::setStatisticsData (StatisticsData *data)
69+ {
70+ this ->statisticsData = data;
71+ }
6872
6973QLayout *StatisticUIHandler::createStatisticsHandlerControls (bool recreateControlsOnly)
7074{
7175 if (!recreateControlsOnly)
7276 {
7377 // Absolutely always only do this once
7478 Q_ASSERT_X (
75- !ui.created (), Q_FUNC_INFO, " The primary statistics controls must only be created once." );
79+ !ui.created (), Q_FUNC_INFO, " The primary statistics controls must only be created once." );
7680 ui.setupUi ();
7781 }
7882
@@ -93,10 +97,8 @@ QLayout *StatisticUIHandler::createStatisticsHandlerControls(bool recreateContro
9397 itemNameCheck->setChecked (statType.render );
9498 itemNameCheck->setToolTip (statType.description );
9599 ui.gridLayout ->addWidget (itemNameCheck, int (row + 2 ), 0 );
96- connect (itemNameCheck,
97- &QCheckBox::stateChanged,
98- this ,
99- &StatisticUIHandler::onStatisticsControlChanged);
100+ connect (
101+ itemNameCheck, QCheckBoxStateChanged, this , &StatisticUIHandler::onStatisticsControlChanged);
100102 itemNameCheckBoxes[0 ].push_back (itemNameCheck);
101103
102104 // Append the opacity slider
@@ -105,17 +107,16 @@ QLayout *StatisticUIHandler::createStatisticsHandlerControls(bool recreateContro
105107 opacitySlider->setMaximum (100 );
106108 opacitySlider->setValue (statType.alphaFactor );
107109 ui.gridLayout ->addWidget (opacitySlider, int (row + 2 ), 1 );
108- connect (opacitySlider,
109- &QSlider::valueChanged,
110- this ,
111- &StatisticUIHandler::onStatisticsControlChanged);
110+ connect (
111+ opacitySlider, &QSlider::valueChanged, this , &StatisticUIHandler::onStatisticsControlChanged);
112112 itemOpacitySliders[0 ].push_back (opacitySlider);
113113
114114 // Append the change style buttons
115115 QPushButton *pushButton = new QPushButton (
116- functionsGui::convertIcon (" :img_edit.png" ), QString (), ui.scrollAreaWidgetContents );
116+ functionsGui::convertIcon (" :img_edit.png" ), QString (), ui.scrollAreaWidgetContents );
117117 ui.gridLayout ->addWidget (pushButton, int (row + 2 ), 2 );
118- connect (pushButton, &QPushButton::released, this , [=] { onStyleButtonClicked (row); });
118+ connect (
119+ pushButton, &QPushButton::released, this , [this , row] { this ->onStyleButtonClicked (row); });
119120 itemStyleButtons[0 ].push_back (pushButton);
120121 }
121122
@@ -144,7 +145,7 @@ QWidget *StatisticUIHandler::getSecondaryStatisticsHandlerControls(bool recreate
144145 if (!this ->statisticsData )
145146 {
146147 DEBUG_STATUI (
147- " StatisticUIHandler::getSecondaryStatisticsHandlerControls statisticsData not set" );
148+ " StatisticUIHandler::getSecondaryStatisticsHandlerControls statisticsData not set" );
148149 return {};
149150 }
150151
@@ -159,7 +160,7 @@ QWidget *StatisticUIHandler::getSecondaryStatisticsHandlerControls(bool recreate
159160 itemNameCheck->setChecked (statType.render );
160161 ui2.gridLayout ->addWidget (itemNameCheck, int (row + 2 ), 0 );
161162 connect (itemNameCheck,
162- &QCheckBox::stateChanged ,
163+ QCheckBoxStateChanged ,
163164 this ,
164165 &StatisticUIHandler::onSecondaryStatisticsControlChanged);
165166 itemNameCheckBoxes[1 ].push_back (itemNameCheck);
@@ -178,9 +179,10 @@ QWidget *StatisticUIHandler::getSecondaryStatisticsHandlerControls(bool recreate
178179
179180 // Append the change style buttons
180181 QPushButton *pushButton = new QPushButton (
181- functionsGui::convertIcon (" :img_edit.png" ), QString (), ui2.scrollAreaWidgetContents );
182+ functionsGui::convertIcon (" :img_edit.png" ), QString (), ui2.scrollAreaWidgetContents );
182183 ui2.gridLayout ->addWidget (pushButton, int (row + 2 ), 2 );
183- connect (pushButton, &QPushButton::released, this , [=] { onStyleButtonClicked (row); });
184+ connect (
185+ pushButton, &QPushButton::released, this , [this , row] { this ->onStyleButtonClicked (row); });
184186 itemStyleButtons[1 ].push_back (pushButton);
185187 }
186188
@@ -190,7 +192,7 @@ QWidget *StatisticUIHandler::getSecondaryStatisticsHandlerControls(bool recreate
190192 if (true || ui2.created ())
191193 {
192194 QSpacerItem *verticalSpacer =
193- new QSpacerItem (1 , 1 , QSizePolicy::Minimum, QSizePolicy::Expanding);
195+ new QSpacerItem (1 , 1 , QSizePolicy::Minimum, QSizePolicy::Expanding);
194196 ui2.gridLayout ->addItem (verticalSpacer, int (statTypes.size () + 2 ), 0 , 1 , 1 );
195197 spacerItems[1 ] = verticalSpacer;
196198 }
@@ -321,8 +323,8 @@ void StatisticUIHandler::updateStatisticsHandlerControls()
321323 }
322324
323325 // First run a check if all statisticsTypes are identical
324- bool controlsStillValid = true ;
325- auto &statTypes = this ->statisticsData ->getStatisticsTypes ();
326+ bool controlsStillValid = true ;
327+ auto &statTypes = this ->statisticsData ->getStatisticsTypes ();
326328 if (statTypes.size () != itemNameCheckBoxes[0 ].size ())
327329 // There are more or less statistics types as before
328330 controlsStillValid = false ;
0 commit comments