我有这张桌子:
QSqlQuery createTblSMS("CREATE TABLE sms_tbl("
"isRead BOOLEAN NOT NULL,"
"readTime DATETIME,"
"arrivalTime DATETIME NOT NULL,"
"sender TEXT NOT NULL,"
"receiver TEXT NOT NULL,"
"smsContent TEXT,"
"PRIMARY KEY(arrivalTime, sender, receiver));", QSqlDatabase::database(mConnectionName));
smsModel = new QSqlTableModel(this, QSqlDatabase::database(mConnectionName));
smsModel->setTable("sms_tbl");
smsModel->select();
如何找到QModelIndex
给定的复合主键,例如:
"2010-08 12 12:04:15" "075588455" "077789585"