Skip to content

Commit 5bcf7fb

Browse files
committed
Plugins::WebBrowser: modify icon in address completer
1 parent 9911ff3 commit 5bcf7fb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Plugins/WebBrowser/AddressCompleter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void CAddressCompleter::attachToLineEdit(QLineEdit *lineEdit)
127127
m_pLineEdit = lineEdit;
128128
if (m_pLineEdit) {
129129
m_pLineEdit->installEventFilter(this);
130-
connect(m_pLineEdit, &QLineEdit::textChanged,
130+
connect(m_pLineEdit, &QLineEdit::textEdited,
131131
this, &CAddressCompleter::onTextChanged);
132132

133133
// 设置提示文本
@@ -271,7 +271,7 @@ void CAddressCompleter::performSearch()
271271
CAddressCompleterItem *completerItem = new CAddressCompleterItem(
272272
title.isEmpty() ? url : title,
273273
url,
274-
getIconForUrl(url)
274+
i.icon
275275
);
276276

277277
m_pListWidget->setItemWidget(item, completerItem);
@@ -523,7 +523,7 @@ QIcon CAddressCompleter::getIconForUrl(const QString &url)
523523
static QIcon defaultIcon;
524524
static QIcon httpIcon;
525525
static QIcon httpsIcon;
526-
static QIcon searchIcon = QIcon::fromTheme(QIcon::ThemeIcon::SystemSearch);
526+
static QIcon searchIcon; // = QIcon::fromTheme(QIcon::ThemeIcon::SystemSearch);
527527

528528
if (url.startsWith("https://")) {
529529
return httpsIcon;

Plugins/WebBrowser/AddressCompleter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ class CAddressCompleter : public QWidget
5555
void showEvent(QShowEvent *event) override;
5656
void hideEvent(QHideEvent *event) override;
5757

58-
private slots:
58+
private Q_SLOTS:
5959
void onTextChanged(const QString &text);
6060
void onItemClicked(QListWidgetItem *item);
61-
void performSearch();
61+
virtual void performSearch();
6262
void moveToNextItem();
6363
void moveToPreviousItem();
6464
void selectCurrentItem();

0 commit comments

Comments
 (0)