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
virtual QStringList splitPath(const QString &s) const
ctkCompleter(QObject *parent=0)
virtual ~ctkCompleter()
ctkCompleter(const QStringList &list, QObject *parent=0)
ctkCompleter(QAbstractItemModel *model, QObject *parent=0)
QAbstractItemModel * sourceModel() const
void setModelFiltering(ModelFiltering filter)
QScopedPointer< ctkCompleterPrivate > d_ptr
Definition: ctkCompleter.h:91
void setSourceModel(QAbstractItemModel *model)
ModelFiltering modelFiltering() const
Q_DECLARE_METATYPE(ctkDICOMPersonName)