MCPcopy Create free account
hub / github.com/QNapi/qnapi / foreach

Function foreach

gui/src/forms/frmsummary.cpp:43–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41
42 int i = 0, goodCount = 0, badCount = 0;
43 foreach (SubtitleInfo s, list) {
44 bool isGood = s.resolution != SUBTITLE_NONE;
45
46 QListWidgetItem *listItem = new QListWidgetItem();
47
48 ui.lwSummary->addItem(listItem);
49
50 subDataWidget *subData = new subDataWidget();
51
52 if (isGood) {
53 ++goodCount;
54 QString lang_path = QString(":/languages/") + s.lang + ".png";
55 QIcon engineIcon =
56 QIcon(QPixmap(enginesRegistry->enginePixmapData(s.engine)));
57 subData->setSubData(succIcon, s.name, QIcon(lang_path), engineIcon);
58 } else {
59 ++badCount;
60 subData->setSubData(failIcon, s.name);
61 }
62
63 ui.lwSummary->setItemWidget(listItem, subData);
64 listItem->setSizeHint(subData->sizeHint());
65
66 ++i;
67 }
68
69 ui.lwSummary->setMinimumWidth(ui.lwSummary->sizeHintForColumn(0) + 20);
70 this->adjustSize();

Callers

nothing calls this directly

Calls 2

setSubDataMethod · 0.80
enginePixmapDataMethod · 0.45

Tested by

no test coverage detected