LeechCraft 0.6.70-14794-g33744ae6ce
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
tagslineedit.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#pragma once
10
11#include <memory>
12#include <QLineEdit>
13#include "tagsconfig.h"
14#include "categoryselector.h"
15
16namespace LC::Util
17{
18 class TagsCompleter;
19 class LineEditButtonManager;
20
28 class UTIL_TAGS_API TagsLineEdit : public QLineEdit
29 {
30 Q_OBJECT
31
32 friend class TagsCompleter;
33
34 CategorySelector *CategorySelector_;
35 TagsCompleter *Completer_ = nullptr;
36
37 QString Separator_;
38 public:
45 explicit TagsLineEdit (QWidget *parent);
46
62 void AddSelector (LineEditButtonManager *manager = nullptr);
63
64 void AddSelector (CategorySelector*);
65
71 QString GetSeparator () const;
72
79 void SetSeparator (const QString&);
80 public slots:
89 void setTags (const QStringList& tags);
90 protected:
91 void keyPressEvent (QKeyEvent*) override;
92 void focusInEvent (QFocusEvent*) override;
93 void contextMenuEvent (QContextMenuEvent*) override;
94 void SetCompleter (TagsCompleter*);
95 private:
103 void InsertTag (const QString& string);
104
105 QString textUnderCursor () const;
106 signals:
107 void tagsChosen ();
108 };
109}
The CategorySelector widget provides a way to select amongst a group of items.
Manages additional overlay buttons in a QLineEdit.
Completer suitable for tag completion.
Definition: tagscompleter.h:39
A line edit class suitable for use with TagsCompleter.
Definition: tagslineedit.h:29
#define UTIL_TAGS_API
Definition: tagsconfig.h:16