天嵌 ARM开发社区

 找回密码
 注册
查看: 1998|回复: 1

QTableView设置单元单元的内容

[复制链接]
hisumg 发表于 2010-10-28 11:03:42 | 显示全部楼层 |阅读模式
我现在遇到了一个问题:就是我想在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。。。很古老的版本了。。
 楼主| hisumg 发表于 2010-10-28 12:02:57 | 显示全部楼层
在线等啊.......
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号-2 )

GMT+8, 2024-9-27 23:22 , Processed in 1.037149 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表