LeechCraft  0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
tagscompleter.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 <QCompleter>
12 #include "tagsconfig.h"
13 
14 namespace LC
15 {
16  class TagsManager;
17 }
18 
19 namespace LC::Util
20 {
21  class TagsLineEdit;
22 
38  class TagsCompleter : public QCompleter
39  {
40  Q_OBJECT
41 
42  UTIL_TAGS_API static QAbstractItemModel *CompletionModel_;
43  friend class LC::TagsManager;
44 
45  TagsLineEdit *Edit_;
46  public:
54  UTIL_TAGS_API explicit TagsCompleter (TagsLineEdit *line);
55 
65  UTIL_TAGS_API void OverrideModel (QAbstractItemModel *model);
66 
75  UTIL_TAGS_API QStringList splitPath (const QString& path) const override;
76  protected:
77  static void SetModel (QAbstractItemModel *model)
78  {
79  CompletionModel_ = model;
80  }
81  };
82 }
#define UTIL_TAGS_API
Definition: tagsconfig.h:16
UTIL_TAGS_API void OverrideModel(QAbstractItemModel *model)
Replaces the model this completer works with.
A line edit class suitable for use with TagsCompleter.
Definition: tagslineedit.h:28
Completer suitable for tag completion.
Definition: tagscompleter.h:38
static void SetModel(QAbstractItemModel *model)
Definition: tagscompleter.h:77
UTIL_TAGS_API TagsCompleter(TagsLineEdit *line)
Constructs the completer.
friend class LC::TagsManager
Definition: tagscompleter.h:43
UTIL_TAGS_API QStringList splitPath(const QString &path) const override
Path splitter override.