| 156 | } |
| 157 | |
| 158 | void adjust_label_size(QLabel *ctrl, AdjustSizeAction action) |
| 159 | { |
| 160 | QSize sz = measure_string(ctrl->font(), ctrl->text()); |
| 161 | |
| 162 | if (action == ADJUST_WIDTH){ |
| 163 | ctrl->setFixedWidth(sz.width() + 5); |
| 164 | } |
| 165 | else if (action == ADJUST_HEIGHT){ |
| 166 | ctrl->setFixedHeight(sz.height() + 5); |
| 167 | } |
| 168 | else{ |
| 169 | ctrl->setFixedHeight(sz.height() + 5); |
| 170 | ctrl->setFixedWidth(sz.width() + 5); |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | } // namespace ui |
no test coverage detected