CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkCompleter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Library: CTK
4 
5  Copyright (c) Kitware Inc.
6 
7  Licensed under the Apache License, Version 2.0 (the "License");
8  you may not use this file except in compliance with the License.
9  You may obtain a copy of the License at
10 
11  http://www.apache.org/licenses/LICENSE-2.0.txt
12 
13  Unless required by applicable law or agreed to in writing, software
14  distributed under the License is distributed on an "AS IS" BASIS,
15  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  See the License for the specific language governing permissions and
17  limitations under the License.
18 
19 =========================================================================*/
20 
21 #ifndef __ctkCompleter_h
22 #define __ctkCompleter_h
23 
24 // Qt includes
25 #include <QCompleter>
26 #include <QMetaType>
27 
28 // CTK includes
29 #include "ctkWidgetsExport.h"
30 class ctkCompleterPrivate;
31 
52 class CTK_WIDGETS_EXPORT ctkCompleter: public QCompleter
53 {
54  Q_OBJECT
55  Q_ENUMS(ModelFiltering)
63  Q_PROPERTY(ModelFiltering modelFiltering READ modelFiltering WRITE setModelFiltering)
64 
65 public:
66  ctkCompleter(QObject* parent = 0);
67  ctkCompleter(QAbstractItemModel* model, QObject* parent = 0);
68  ctkCompleter(const QStringList& list, QObject* parent = 0 );
69  virtual ~ctkCompleter();
70 
72  {
73  FilterStartsWith=0,
75  FilterWordStartsWith
76  };
77 
80 
81  virtual QStringList splitPath(const QString& s)const;
82 
87  QAbstractItemModel* sourceModel()const;
88  void setSourceModel(QAbstractItemModel* model);
89 
90 protected:
91  QScopedPointer<ctkCompleterPrivate> d_ptr;
92 
93 private:
94  Q_DECLARE_PRIVATE(ctkCompleter);
95  Q_DISABLE_COPY(ctkCompleter);
96 };
97 
99 
100 #endif // __ctkCompleter_h
ctkCompleter::setSourceModel
void setSourceModel(QAbstractItemModel *model)
ctkCompleter::modelFiltering
ModelFiltering modelFiltering() const
ctkCompleter::splitPath
virtual QStringList splitPath(const QString &s) const
ctkCompleter::setModelFiltering
void setModelFiltering(ModelFiltering filter)
ctkCompleter::FilterContains
@ FilterContains
Definition: ctkCompleter.h:74
ctkCompleter
Definition: ctkCompleter.h:53
ctkCompleter::sourceModel
QAbstractItemModel * sourceModel() const
ctkCompleter::d_ptr
QScopedPointer< ctkCompleterPrivate > d_ptr
Definition: ctkCompleter.h:91
ctkCompleter::ctkCompleter
ctkCompleter(QAbstractItemModel *model, QObject *parent=0)
ctkCompleter::~ctkCompleter
virtual ~ctkCompleter()
ctkCompleter::ctkCompleter
ctkCompleter(QObject *parent=0)
ctkCompleter::ctkCompleter
ctkCompleter(const QStringList &list, QObject *parent=0)
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(ctkDICOMPersonName)
ctkCompleter::ModelFiltering
ModelFiltering
Definition: ctkCompleter.h:72