From 62a6f626620b46a8649f2ebbaa4748afeb558e48 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Fri, 29 Dec 2017 17:33:47 +0100 Subject: Using QCompleter to provide address bar completions - known issue: it doesn't search trees well --- src/lib/bookmarks/bookmarkswidget.cpp | 5 +++++ src/lib/bookmarks/bookmarkswidget.h | 2 ++ 2 files changed, 7 insertions(+) (limited to 'src/lib/bookmarks') diff --git a/src/lib/bookmarks/bookmarkswidget.cpp b/src/lib/bookmarks/bookmarkswidget.cpp index 10a5424..cb191c7 100644 --- a/src/lib/bookmarks/bookmarkswidget.cpp +++ b/src/lib/bookmarks/bookmarkswidget.cpp @@ -75,6 +75,11 @@ QStringList BookmarksWidget::bookmarksFor(const QString &term) return ret; } +QAbstractItemModel *BookmarksWidget::model() const +{ + return ui->treeWidget->model(); +} + QStringList BookmarksWidget::searchItem(QTreeWidgetItem *item, const QString &term) { if(item->text(1).contains(term)) { diff --git a/src/lib/bookmarks/bookmarkswidget.h b/src/lib/bookmarks/bookmarkswidget.h index 5e5af12..aa188b2 100644 --- a/src/lib/bookmarks/bookmarkswidget.h +++ b/src/lib/bookmarks/bookmarkswidget.h @@ -11,6 +11,7 @@ #include #include "xbel.h" +#include namespace Ui { class BookmarksDialog; @@ -31,6 +32,7 @@ signals: public slots: QStringList bookmarksFor(const QString &term); + QAbstractItemModel *model() const; private slots: void openItem(QTreeWidgetItem *item, int column); -- cgit v1.2.1