MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / onItemClicked

Method onItemClicked

Plugins/WebBrowser/AddressCompleter.cpp:421–446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419}
420
421void CAddressCompleter::onItemClicked(QListWidgetItem *item)
422{
423 if (!item) return;
424
425 QString url = item->data(Qt::UserRole).toString();
426
427 // 处理搜索请求
428 if (url.startsWith("@search:", Qt::CaseInsensitive)) {
429 QString keyword = url.mid(8);
430 //qDebug(log) << "emit searchRequested:" << keyword;
431 emit searchRequested(keyword);
432 } if(url.startsWith("@")) {
433 emit sigCommand(url);
434 }else {
435 //qDebug(log) << "emit urlSelected:" << url;
436 emit urlSelected(url);
437 }
438
439 hideCompleter();
440
441 // 将URL填入地址栏
442 if (m_pLineEdit) {
443 m_pLineEdit->setText(url);
444 m_pLineEdit->setFocus();
445 }
446}
447
448void CAddressCompleter::moveToNextItem()
449{

Callers

nothing calls this directly

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected