qsqlquerymodel.sip 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // qsqlquerymodel.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtSql 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 QSqlQueryModel : public QAbstractTableModel
  22. {
  23. %TypeHeaderCode
  24. #include <qsqlquerymodel.h>
  25. %End
  26. public:
  27. explicit QSqlQueryModel(QObject *parent /TransferThis/ = 0);
  28. virtual ~QSqlQueryModel();
  29. virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
  30. virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
  31. QSqlRecord record() const;
  32. QSqlRecord record(int row) const;
  33. virtual QVariant data(const QModelIndex &item, int role = Qt::DisplayRole) const;
  34. virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
  35. virtual bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole);
  36. virtual bool insertColumns(int column, int count, const QModelIndex &parent = QModelIndex());
  37. virtual bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex());
  38. void setQuery(const QSqlQuery &query);
  39. void setQuery(const QString &query, const QSqlDatabase &db = QSqlDatabase());
  40. %If (Qt_6_5_0 -)
  41. const QSqlQuery &query() const;
  42. %MethodCode
  43. sipRes = new QSqlQuery(sipCpp->query(Qt::Disambiguated));
  44. %End
  45. %End
  46. %If (- Qt_6_5_0)
  47. QSqlQuery query() const;
  48. %End
  49. virtual void clear();
  50. QSqlError lastError() const;
  51. virtual void fetchMore(const QModelIndex &parent = QModelIndex());
  52. virtual bool canFetchMore(const QModelIndex &parent = QModelIndex()) const;
  53. protected:
  54. virtual void queryChange();
  55. virtual QModelIndex indexInQuery(const QModelIndex &item) const;
  56. void setLastError(const QSqlError &error);
  57. void beginResetModel();
  58. void endResetModel();
  59. void beginInsertRows(const QModelIndex &parent, int first, int last);
  60. void endInsertRows();
  61. void beginRemoveRows(const QModelIndex &parent, int first, int last);
  62. void endRemoveRows();
  63. void beginInsertColumns(const QModelIndex &parent, int first, int last);
  64. void endInsertColumns();
  65. void beginRemoveColumns(const QModelIndex &parent, int first, int last);
  66. void endRemoveColumns();
  67. public:
  68. virtual QHash<int, QByteArray> roleNames() const;
  69. %If (Qt_6_9_0 -)
  70. void refresh();
  71. %End
  72. };