|
我现在遇到了一个问题:就是我想在QTableVIew由按钮按下然后能够更新QTableview某一单元的内容,可我查了QT文档只有paintCell()和repaint()这两个函数,可我还需要将一个数组的内容显示在表格里,槽函数如下,请问高手指导。。。。
void refresh_slot()
{
sqlite3 *db=NULL;
char *szErrMsg=0;
const char *sql="select *from account";
char** resOfCnt;//save the result set.
int resRow,resCol;//rows and columns of the result
int ret;
int rc=::sqlite3_open("/opt/FriendlyARM/mini2440/x86-qtopia/splitter_test/famInfo.db",&db);
if(rc==SQLITE_OK)
{
rc=sqlite3_table_table(db,sql,&resOfCnt,&resRow,&resCol,&szErrMsg);
if(rc=SQLITE_OK)
{
//.....就把resOfCnt的内容添加进table里边
}
}
}
ps;我用的qt2。。。很古老的版本了。。 |
|