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

Method on_set

DSView/pv/dock/searchdock.cpp:218–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218void SearchDock::on_set()
219{
220 dialogs::Search dlg(this, _session, _pattern);
221 connect(_session->device_event_object(), SIGNAL(device_updated()), &dlg, SLOT(reject()));
222
223 if (dlg.exec()) {
224 std::map<uint16_t, QString> new_pattern = dlg.get_pattern();
225
226 QString search_label;
227 for (auto& iter:new_pattern) {
228 iter.second.remove(QChar(' '), Qt::CaseInsensitive);
229 iter.second = iter.second.toUpper();
230 search_label.push_back(iter.second);
231 }
232
233 _search_value->setText(search_label);
234 QFontMetrics fm = this->fontMetrics();
235 //fm.width(search_label)
236 int tw = fm.boundingRect(search_label).width();
237 _search_value->setFixedWidth(tw + _search_button->width()+20);
238
239 if (new_pattern != _pattern) {
240 _view.set_search_pos(_view.get_search_pos(), false);
241 _pattern = new_pattern;
242 }
243 }
244}
245
246void SearchDock::UpdateLanguage()
247{

Callers

nothing calls this directly

Calls 5

device_event_objectMethod · 0.80
get_patternMethod · 0.80
set_search_posMethod · 0.80
get_search_posMethod · 0.80
execMethod · 0.45

Tested by

no test coverage detected