| 58 | } |
| 59 | |
| 60 | void 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 | |
| 80 | void SetButtonIcon(QAbstractButton *button, const char *path) |
| 81 | { |
no test coverage detected