MatchFilterCompleter.cpp
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (C) 2015 by Ralf Kaestner *
3  * ralf.kaestner@gmail.com *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the Lesser GNU General Public License as published by*
7  * the Free Software Foundation; either version 3 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * Lesser GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the Lesser GNU General Public License *
16  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17  ******************************************************************************/
18 
19 #include <QStringList>
20 
22 
23 namespace rqt_multiplot {
24 
25 /*****************************************************************************/
26 /* Constructors and Destructor */
27 /*****************************************************************************/
28 
29 MatchFilterCompleter::MatchFilterCompleter(QObject* parent, Qt::MatchFlags
30  filterMatchFlags) :
31  QCompleter(parent),
32  proxyModel_(new MatchFilterCompleterModel(this, filterMatchFlags)) {
33  setCompletionMode(QCompleter::UnfilteredPopupCompletion);
34 }
35 
37 }
38 
39 /*****************************************************************************/
40 /* Accessors */
41 /*****************************************************************************/
42 
43 void MatchFilterCompleter::setFilterMatchFlags(Qt::MatchFlags flags) {
45 }
46 
49 }
50 
52  caseSensitivity) {
53  proxyModel_->setFilterCaseSensitivity(caseSensitivity);
54 }
55 
57  return proxyModel_->filterCaseSensitivity();
58 }
59 
60 /*****************************************************************************/
61 /* Methods */
62 /*****************************************************************************/
63 
64 QStringList MatchFilterCompleter::splitPath(const QString& path) const {
65  QAbstractItemModel* sourceModel = model();
66 
67  if (sourceModel && (sourceModel != proxyModel_)) {
68  sourceModel->setParent(proxyModel_);
69  proxyModel_->setSourceModel(sourceModel);
70 
71  const_cast<MatchFilterCompleter*>(this)->setModel(proxyModel_);
72  }
73 
75 
76  return QStringList();
77 }
78 
79 }
QStringList splitPath(const QString &path) const
MatchFilterCompleter(QObject *parent=0, Qt::MatchFlags filterMatchFlags=Qt::MatchStartsWith)
void setFilterCaseSensitivity(Qt::CaseSensitivity caseSensitivity)
MatchFilterCompleterModel * proxyModel_
void setFilterMatchFlags(Qt::MatchFlags flags)
Qt::CaseSensitivity getFilterCaseSensitivity() const


rqt_multiplot_plugin
Author(s): Ralf Kaestner
autogenerated on Fri Jan 15 2021 03:47:53