MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / SetHeightToContentHeight

Function SetHeightToContentHeight

lib/utils/ui-helpers.cpp:60–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60void SetHeightToContentHeight(QListWidget *list)
61{
62 auto nrItems = list->count();
63 if (nrItems == 0) {
64 list->setMaximumHeight(0);
65 list->setMinimumHeight(0);
66 return;
67 }
68
69 int scrollBarHeight = getHorizontalScrollBarHeight(list);
70 int height = 2 * list->frameWidth() + scrollBarHeight;
71
72 for (int i = 0; i < nrItems; i++) {
73 height += (list->sizeHintForRow(i) + list->spacing());
74 }
75
76 list->setMinimumHeight(height);
77 list->setMaximumHeight(height);
78}
79
80void SetButtonIcon(QAbstractButton *button, const char *path)
81{

Callers 1

UpdateListSizeMethod · 0.70

Calls 2

countMethod · 0.80

Tested by

no test coverage detected