MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / reflowCheckBoxes

Method reflowCheckBoxes

pcsx2-qt/Settings/SettingsWidget.cpp:119–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119void SettingsWidget::reflowCheckBoxes(QGridLayout* layout)
120{
121 std::vector<QWidget*> widgets;
122
123 for (int row = 0; row < layout->rowCount(); row++)
124 {
125 for (int column = 0; column < layout->columnCount(); column++)
126 {
127 QLayoutItem* item = layout->itemAtPosition(row, column);
128 if (item && item->widget())
129 {
130 widgets.push_back(item->widget());
131 layout->removeWidget(item->widget());
132 }
133 }
134 }
135
136 for (size_t i = 0; i < widgets.size(); i++)
137 {
138 int row = static_cast<int>(i / 2);
139 int column = static_cast<int>(i % 2);
140 layout->addWidget(widgets[i], row, column);
141 }
142}
143
144#include "moc_SettingsWidget.cpp"

Callers

nothing calls this directly

Calls 5

addWidgetMethod · 0.80
rowCountMethod · 0.45
columnCountMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected