qcompleter.sip 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. // qcompleter.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtWidgets Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  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. class QCompleter : public QObject
  22. {
  23. %TypeHeaderCode
  24. #include <qcompleter.h>
  25. %End
  26. public:
  27. enum CompletionMode
  28. {
  29. PopupCompletion,
  30. UnfilteredPopupCompletion,
  31. InlineCompletion,
  32. };
  33. enum ModelSorting
  34. {
  35. UnsortedModel,
  36. CaseSensitivelySortedModel,
  37. CaseInsensitivelySortedModel,
  38. };
  39. QCompleter(QAbstractItemModel *model, QObject *parent /TransferThis/ = 0);
  40. QCompleter(const QStringList &list, QObject *parent /TransferThis/ = 0);
  41. QCompleter(QObject *parent /TransferThis/ = 0);
  42. virtual ~QCompleter();
  43. void setWidget(QWidget *widget /Transfer/);
  44. QWidget *widget() const;
  45. void setModel(QAbstractItemModel *c /KeepReference/);
  46. QAbstractItemModel *model() const;
  47. void setCompletionMode(QCompleter::CompletionMode mode);
  48. QCompleter::CompletionMode completionMode() const;
  49. QAbstractItemView *popup() const;
  50. void setPopup(QAbstractItemView *popup /Transfer/);
  51. void setCaseSensitivity(Qt::CaseSensitivity caseSensitivity);
  52. Qt::CaseSensitivity caseSensitivity() const;
  53. void setModelSorting(QCompleter::ModelSorting sorting);
  54. QCompleter::ModelSorting modelSorting() const;
  55. void setCompletionColumn(int column);
  56. int completionColumn() const;
  57. void setCompletionRole(int role);
  58. int completionRole() const;
  59. int completionCount() const;
  60. bool setCurrentRow(int row);
  61. int currentRow() const;
  62. QModelIndex currentIndex() const;
  63. QString currentCompletion() const;
  64. QAbstractItemModel *completionModel() const;
  65. QString completionPrefix() const;
  66. virtual QString pathFromIndex(const QModelIndex &index) const;
  67. virtual QStringList splitPath(const QString &path) const;
  68. bool wrapAround() const;
  69. public slots:
  70. void complete(const QRect &rect = QRect());
  71. void setCompletionPrefix(const QString &prefix);
  72. void setWrapAround(bool wrap);
  73. protected:
  74. virtual bool eventFilter(QObject *o, QEvent *e);
  75. virtual bool event(QEvent *);
  76. signals:
  77. void activated(const QString &text);
  78. void activated(const QModelIndex &index);
  79. void highlighted(const QString &text);
  80. void highlighted(const QModelIndex &index);
  81. public:
  82. int maxVisibleItems() const;
  83. void setMaxVisibleItems(int maxItems);
  84. void setFilterMode(Qt::MatchFlags filterMode);
  85. Qt::MatchFlags filterMode() const;
  86. };