InfixCompleter.cpp
Go to the documentation of this file.
1#include "InfixCompleter.h"
2
3#include <QListView>
4#include <QStringListModel>
5
6#include "InfixFilterModel.h"
7
8namespace armarx
9{
10
11 InfixCompleter::InfixCompleter(const QStringList& completionList, QObject* parent) :
12 QCompleter(parent)
13 {
14 QListView* popup = new QListView();
15 completionModel = new QStringListModel(completionList, this);
17 proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
18 proxyModel->setSourceModel(completionModel);
19 setModel(proxyModel);
20 setPopup(popup);
21 setCaseSensitivity(Qt::CaseInsensitive);
22 }
23
24 void
25 InfixCompleter::setCompletionList(const QStringList& completionList)
26 {
27 completionModel->setStringList(completionList);
28 }
29
32 {
33 return proxyModel;
34 }
35
36 QStringList
37 InfixCompleter::splitPath(const QString& path) const
38 {
39 return QStringList("");
40 }
41
42 void
44 {
45 proxyModel->setFilterFixedString(infix);
46 }
47
48
49} // namespace armarx
void setCompletionInfix(const QString &infix)
void setCompletionList(const QStringList &completionList)
InfixCompleter(const QStringList &completionList, QObject *parent=0)
QStringList splitPath(const QString &path) const override
InfixFilterModel * getProxyModel() const
InfixFilterModel * proxyModel
QStringListModel * completionModel
This proxy model reimplements the filterAcceptsRow function with a new behavior: All elements that fi...
This file offers overloads of toIce() and fromIce() functions for STL container types.