QML TableView get data from specific cell (selected row + specific column)
问题 I have QML TableView with QSqlQueryModel . I need to select any row and get data from every column of table to separate TextField . Here is abonentstable.h: #pragma once #include <QObject> #include <QSqlQueryModel> class AbonentsSqlModel : public QSqlQueryModel { Q_OBJECT public: explicit AbonentsSqlModel(QObject *parent = 0); void setQuery(const QString &query, const QSqlDatabase &db = QSqlDatabase()); QVariant data(const QModelIndex &index, int role) const; QHash<int, QByteArray> roleNames(