1// qcompleter.sip generated by MetaSIP 2// 3// This file is part of the QtWidgets Python extension module. 4// 5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com> 6// 7// This file is part of PyQt5. 8// 9// This file may be used under the terms of the GNU General Public License 10// version 3.0 as published by the Free Software Foundation and appearing in 11// the file LICENSE included in the packaging of this file. Please review the 12// following information to ensure the GNU General Public License version 3.0 13// requirements will be met: http://www.gnu.org/copyleft/gpl.html. 14// 15// If you do not wish to use this file under the terms of the GPL version 3.0 16// then you may purchase a commercial license. For more information contact 17// info@riverbankcomputing.com. 18// 19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 21 22 23class QCompleter : QObject 24{ 25%TypeHeaderCode 26#include <qcompleter.h> 27%End 28 29public: 30 enum CompletionMode 31 { 32 PopupCompletion, 33 UnfilteredPopupCompletion, 34 InlineCompletion, 35 }; 36 37 enum ModelSorting 38 { 39 UnsortedModel, 40 CaseSensitivelySortedModel, 41 CaseInsensitivelySortedModel, 42 }; 43 44 QCompleter(QObject *parent /TransferThis/ = 0); 45 QCompleter(QAbstractItemModel *model, QObject *parent /TransferThis/ = 0); 46 QCompleter(const QStringList &list, QObject *parent /TransferThis/ = 0); 47 virtual ~QCompleter(); 48 void setWidget(QWidget *widget /Transfer/); 49 QWidget *widget() const; 50 void setModel(QAbstractItemModel *c /KeepReference/); 51 QAbstractItemModel *model() const; 52 void setCompletionMode(QCompleter::CompletionMode mode); 53 QCompleter::CompletionMode completionMode() const; 54 QAbstractItemView *popup() const; 55 void setPopup(QAbstractItemView *popup /Transfer/); 56 void setCaseSensitivity(Qt::CaseSensitivity caseSensitivity); 57 Qt::CaseSensitivity caseSensitivity() const; 58 void setModelSorting(QCompleter::ModelSorting sorting); 59 QCompleter::ModelSorting modelSorting() const; 60 void setCompletionColumn(int column); 61 int completionColumn() const; 62 void setCompletionRole(int role); 63 int completionRole() const; 64 int completionCount() const; 65 bool setCurrentRow(int row); 66 int currentRow() const; 67 QModelIndex currentIndex() const; 68 QString currentCompletion() const; 69 QAbstractItemModel *completionModel() const; 70 QString completionPrefix() const; 71 virtual QString pathFromIndex(const QModelIndex &index) const; 72 virtual QStringList splitPath(const QString &path) const; 73 bool wrapAround() const; 74 75public slots: 76 void complete(const QRect &rect = QRect()); 77 void setCompletionPrefix(const QString &prefix); 78 void setWrapAround(bool wrap); 79 80protected: 81 virtual bool eventFilter(QObject *o, QEvent *e); 82 virtual bool event(QEvent *); 83 84signals: 85 void activated(const QString &text); 86 void activated(const QModelIndex &index); 87 void highlighted(const QString &text); 88 void highlighted(const QModelIndex &index); 89 90public: 91 int maxVisibleItems() const; 92 void setMaxVisibleItems(int maxItems); 93%If (Qt_5_2_0 -) 94 void setFilterMode(Qt::MatchFlags filterMode); 95%End 96%If (Qt_5_2_0 -) 97 Qt::MatchFlags filterMode() const; 98%End 99}; 100