aboutsummaryrefslogtreecommitdiff
path: root/src/lib/navigation/urllineedit.h
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-12-29 17:33:47 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2017-12-29 17:33:47 +0100
commit62a6f626620b46a8649f2ebbaa4748afeb558e48 (patch)
tree4515ba1d3c24fecf7507bfaefb1ad64f6a685404 /src/lib/navigation/urllineedit.h
parentOff-the-record profile settings (diff)
downloadsmolbote-62a6f626620b46a8649f2ebbaa4748afeb558e48.tar.xz
Using QCompleter to provide address bar completions
- known issue: it doesn't search trees well
Diffstat (limited to 'src/lib/navigation/urllineedit.h')
-rw-r--r--src/lib/navigation/urllineedit.h16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/lib/navigation/urllineedit.h b/src/lib/navigation/urllineedit.h
index 73b31a3..9dd73ab 100644
--- a/src/lib/navigation/urllineedit.h
+++ b/src/lib/navigation/urllineedit.h
@@ -11,21 +11,22 @@
#include <QLineEdit>
#include <QTextLayout>
-#include <QListWidget>
#include <QAction>
+class QAbstractItemModel;
class QMenu;
class QLabel;
-class MainWindow;
class UrlLineEdit : public QLineEdit
{
Q_OBJECT
public:
- explicit UrlLineEdit(MainWindow *window, QWidget *parent = nullptr);
+ explicit UrlLineEdit(QWidget *parent = nullptr);
QAction *sslAction();
QAction *pageAction();
+ void setCompleterModel(QAbstractItemModel *model);
+
signals:
void addressEntered(const QUrl &url);
void searchTermEntered(const QString &term);
@@ -36,11 +37,6 @@ public slots:
protected:
void focusInEvent(QFocusEvent *event);
- void resizeEvent(QResizeEvent *event);
- void keyPressEvent(QKeyEvent *event);
-
-private slots:
- void showCompleter(const QString &text);
private:
void setTextFormat(const QTextLayout::FormatRange &format);
@@ -48,7 +44,6 @@ private:
QTextLayout::FormatRange m_hostFormat;
- MainWindow *m_window;
QAction *m_sslAction = nullptr;
QAction *m_pageAction = nullptr;
@@ -56,8 +51,7 @@ private:
QMenu *m_sslMenu;
QLabel *m_sslLabel;
- QMenu *m_menu;
- QListWidget *listWidget;
+ QCompleter *m_completer;
};
#endif // URLLINEEDIT_H