24 Q_DECLARE_PRIVATE(QSqlQueryModel)
27 explicit QSqlQueryModel(QObject *parent =
nullptr);
28 virtual ~QSqlQueryModel();
30 int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
31 int columnCount(
const QModelIndex &parent = QModelIndex())
const override;
32 QSqlRecord record(
int row)
const;
33 QSqlRecord record()
const;
35 QVariant data(
const QModelIndex &item,
int role = Qt::DisplayRole)
const override;
36 QVariant headerData(
int section, Qt::Orientation orientation,
37 int role = Qt::DisplayRole)
const override;
38 bool setHeaderData(
int section, Qt::Orientation orientation,
const QVariant &value,
39 int role = Qt::EditRole) override;
41 bool insertColumns(
int column,
int count,
const QModelIndex &parent = QModelIndex()) override;
42 bool removeColumns(
int column,
int count,
const QModelIndex &parent = QModelIndex()) override;
44#if QT_REMOVAL_QT7_DEPRECATED_SINCE(6
, 2
)
45 QT_DEPRECATED_VERSION_X_6_2(
"QSqlQuery is not meant to be copied. Pass it by move instead.")
46 void setQuery(
const QSqlQuery &query);
48 void setQuery(QSqlQuery &&query);
49 void setQuery(
const QString &query,
const QSqlDatabase &db = QSqlDatabase());
51#if QT_SQL_REMOVED_SINCE(6
, 5
)
52 QSqlQuery query()
const;
54 const QSqlQuery &query(QT6_DECL_NEW_OVERLOAD)
const;
58 QSqlError lastError()
const;
60 void fetchMore(
const QModelIndex &parent = QModelIndex()) override;
61 bool canFetchMore(
const QModelIndex &parent = QModelIndex())
const override;
63 QHash<
int, QByteArray> roleNames()
const override;
66 void beginInsertRows(
const QModelIndex &parent,
int first,
int last);
69 void beginRemoveRows(
const QModelIndex &parent,
int first,
int last);
72 void beginInsertColumns(
const QModelIndex &parent,
int first,
int last);
73 void endInsertColumns();
75 void beginRemoveColumns(
const QModelIndex &parent,
int first,
int last);
76 void endRemoveColumns();
78 void beginResetModel();
80 virtual void queryChange();
82 virtual QModelIndex indexInQuery(
const QModelIndex &item)
const;
83 void setLastError(
const QSqlError &error);
84 QSqlQueryModel(QSqlQueryModelPrivate &dd, QObject *parent =
nullptr);