LeechCraft
0.6.70-18450-gabe19ee3b0
Modular cross-platform feature rich live environment.
Toggle main menu visibility
Loading...
Searching...
No Matches
tagscompleter.cpp
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
#include "
tagscompleter.h
"
10
#include <QtDebug>
11
#include <QStringList>
12
#include "
tagslineedit.h
"
13
14
namespace
LC::Util
15
{
16
QAbstractItemModel *TagsCompleter::CompletionModel_ =
nullptr
;
17
18
TagsCompleter::TagsCompleter
(
TagsLineEdit
*toComplete)
19
: QCompleter (toComplete)
20
, Edit_ (toComplete)
21
{
22
setCompletionRole (Qt::DisplayRole);
23
setModel (CompletionModel_);
24
toComplete->
SetCompleter
(
this
);
25
}
26
27
void
TagsCompleter::OverrideModel
(QAbstractItemModel *model)
28
{
29
setModel (model);
30
}
31
32
QStringList
TagsCompleter::splitPath
(
const
QString&
string
)
const
33
{
34
const
auto
& sep = Edit_->GetSeparator ().trimmed ();
35
auto
result =
string
.split (sep, Qt::SkipEmptyParts);
36
for
(
auto
& s : result)
37
s = s.trimmed ();
38
return
result;
39
}
40
}
LC::Util::TagsCompleter::TagsCompleter
UTIL_TAGS_API TagsCompleter(TagsLineEdit *line)
Constructs the completer.
Definition
tagscompleter.cpp:18
LC::Util::TagsCompleter::splitPath
UTIL_TAGS_API QStringList splitPath(const QString &path) const override
Path splitter override.
Definition
tagscompleter.cpp:32
LC::Util::TagsCompleter::OverrideModel
UTIL_TAGS_API void OverrideModel(QAbstractItemModel *model)
Replaces the model this completer works with.
Definition
tagscompleter.cpp:27
LC::Util::TagsLineEdit
A line edit class suitable for use with TagsCompleter.
Definition
tagslineedit.h:29
LC::Util::TagsLineEdit::SetCompleter
void SetCompleter(TagsCompleter *)
Definition
tagslineedit.cpp:182
LC::Util
Definition
icoreproxy.h:34
tagscompleter.h
tagslineedit.h
src
util
tags
tagscompleter.cpp
Generated by
1.17.0