MCPcopy Index your code
hub / github.com/DreamSourceLab/DSView / adjust_label_size

Function adjust_label_size

DSView/pv/ui/fn.cpp:158–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

update_device_infoMethod · 0.85

Calls 1

measure_stringFunction · 0.85

Tested by

no test coverage detected