MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / UpdateFont

Method UpdateFont

DSView/pv/dock/triggerdock.cpp:1078–1121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1076}
1077
1078void TriggerDock::UpdateFont()
1079{
1080 QFont font = this->font();
1081 font.setPointSizeF(AppConfig::Instance().appOptions.fontSize);
1082 ui::set_form_font(this, font);
1083 font.setPointSizeF(font.pointSizeF() + 1);
1084 this->parentWidget()->setFont(font);
1085
1086 _adv_tabWidget->setFont(font);
1087 _adv_tabWidget->widget(0)->setFont(font);
1088 _adv_tabWidget->widget(1)->setFont(font);
1089 _adv_tabWidget->tabBar()->setFont(font);
1090
1091 QFont font2 = this->font();
1092 font2.setPointSizeF(AppConfig::Instance().appOptions.fontSize);
1093 QFontMetrics fm(font2);
1094
1095 auto edits = this->findChildren<PopupLineEdit*>();
1096 int lineH = 30;
1097
1098 for(auto o : edits)
1099 {
1100 if (o != _serial_hex_lineEdit && o->text() != "")
1101 {
1102 QRect rc = fm.boundingRect(o->text());
1103 QSize size(rc.width() + 20, rc.height() + 6);
1104 o->setMinimumSize(size);
1105 lineH = size.height();
1106 }
1107 }
1108
1109 _serial_hex_lineEdit->setFixedHeight(lineH);
1110
1111 int lines = 3 * 2;
1112 if (_cur_ch_num == 32){
1113 lines = 6 * 2;
1114 }
1115
1116 int pageHeight = (lineH + 15) * lines;
1117 pageHeight += lineH * 10;
1118 pageHeight += 250;
1119
1120 _serial_groupBox->setFixedHeight(pageHeight);
1121}
1122
1123} // namespace dock
1124} // namespace pv

Callers

nothing calls this directly

Calls 1

set_form_fontFunction · 0.85

Tested by

no test coverage detected