qtableview.sip 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. // qtableview.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 QTableView : public QAbstractItemView
  22. {
  23. %TypeHeaderCode
  24. #include <qtableview.h>
  25. %End
  26. public:
  27. explicit QTableView(QWidget *parent /TransferThis/ = 0);
  28. virtual ~QTableView();
  29. virtual void setModel(QAbstractItemModel *model /KeepReference/);
  30. virtual void setRootIndex(const QModelIndex &index);
  31. virtual void setSelectionModel(QItemSelectionModel *selectionModel /KeepReference/);
  32. QHeaderView *horizontalHeader() const;
  33. QHeaderView *verticalHeader() const;
  34. void setHorizontalHeader(QHeaderView *header /Transfer/);
  35. void setVerticalHeader(QHeaderView *header /Transfer/);
  36. int rowViewportPosition(int row) const;
  37. void setRowHeight(int row, int height);
  38. int rowHeight(int row) const;
  39. int rowAt(int y) const;
  40. int columnViewportPosition(int column) const;
  41. void setColumnWidth(int column, int width);
  42. int columnWidth(int column) const;
  43. int columnAt(int x) const;
  44. bool isRowHidden(int row) const;
  45. void setRowHidden(int row, bool hide);
  46. bool isColumnHidden(int column) const;
  47. void setColumnHidden(int column, bool hide);
  48. bool showGrid() const;
  49. void setShowGrid(bool show);
  50. Qt::PenStyle gridStyle() const;
  51. void setGridStyle(Qt::PenStyle style);
  52. virtual QRect visualRect(const QModelIndex &index) const;
  53. virtual void scrollTo(const QModelIndex &index, QAbstractItemView::ScrollHint hint = QAbstractItemView::EnsureVisible);
  54. virtual QModelIndex indexAt(const QPoint &p) const;
  55. public slots:
  56. void selectRow(int row);
  57. void selectColumn(int column);
  58. void hideRow(int row);
  59. void hideColumn(int column);
  60. void showRow(int row);
  61. void showColumn(int column);
  62. void resizeRowToContents(int row);
  63. void resizeRowsToContents();
  64. void resizeColumnToContents(int column);
  65. void resizeColumnsToContents();
  66. protected slots:
  67. void rowMoved(int row, int oldIndex, int newIndex);
  68. void columnMoved(int column, int oldIndex, int newIndex);
  69. void rowResized(int row, int oldHeight, int newHeight);
  70. void columnResized(int column, int oldWidth, int newWidth);
  71. void rowCountChanged(int oldCount, int newCount);
  72. void columnCountChanged(int oldCount, int newCount);
  73. protected:
  74. virtual void scrollContentsBy(int dx, int dy);
  75. virtual void paintEvent(QPaintEvent *e);
  76. virtual void timerEvent(QTimerEvent *event);
  77. virtual int horizontalOffset() const;
  78. virtual int verticalOffset() const;
  79. virtual QModelIndex moveCursor(QAbstractItemView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers);
  80. virtual void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command);
  81. virtual QRegion visualRegionForSelection(const QItemSelection &selection) const;
  82. virtual QModelIndexList selectedIndexes() const;
  83. virtual void updateGeometries();
  84. virtual int sizeHintForRow(int row) const;
  85. virtual int sizeHintForColumn(int column) const;
  86. virtual void verticalScrollbarAction(int action);
  87. virtual void horizontalScrollbarAction(int action);
  88. virtual bool isIndexHidden(const QModelIndex &index) const;
  89. virtual QSize viewportSizeHint() const;
  90. public:
  91. void setSortingEnabled(bool enable);
  92. bool isSortingEnabled() const;
  93. void setSpan(int row, int column, int rowSpan, int columnSpan);
  94. int rowSpan(int row, int column) const;
  95. int columnSpan(int row, int column) const;
  96. void sortByColumn(int column, Qt::SortOrder order);
  97. void setWordWrap(bool on);
  98. bool wordWrap() const;
  99. void setCornerButtonEnabled(bool enable);
  100. bool isCornerButtonEnabled() const;
  101. void clearSpans();
  102. protected:
  103. virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
  104. virtual void currentChanged(const QModelIndex &current, const QModelIndex &previous);
  105. virtual void initViewItemOption(QStyleOptionViewItem *option) const;
  106. %If (Qt_6_8_0 -)
  107. virtual void dropEvent(QDropEvent *event);
  108. %End
  109. };