posts - 10,  comments - 2,  trackbacks - 0
     摘要: QDataWidgetMapper将一个数据库记录字段反映到其映射的窗口部件中,同时将窗口部件中所做出的更改反映回数据库,关键是关联一个model和一组widget
一、步骤

1、创建 QDataWidgetMapper 对象
2、关联 model
3、关联 widgets,并创建其与model中section的映射
4、定位到某个record

  阅读全文
posted @ 2011-11-23 16:32 再生的雄鹰| 编辑 收藏
     摘要: 该类为单张的数据库表提供了一个可编辑的数据模型,它支持外键,除此之外和QSqlTableModel没有什么不同
  阅读全文
posted @ 2011-11-23 16:29 再生的雄鹰| 编辑 收藏
     摘要: QSqlTableModel类继承至QSqlQueryModel类,该类提供了一个可读写单张SQL表的可编辑数据模型,功能:修改,插入,删除,查询,和排序

常用函数

QVariant headerData ( int section,Qt::Orientation orientation, int role = Qt::DisplayRole ) const 获取水平头或垂直头标题

bool setHeaderData ( int section,Qt::Orientation orientation, const QVariant & value, int role = Qt::EditRole ) 设置水平头或垂直头标题

int rowCount ( const QModelIndex & parent= QModelIndex() ) const // 返回行数

int columnCount ( const QModelIndex &index = QModelIndex() ) co  阅读全文
posted @ 2011-11-22 17:47 再生的雄鹰| 编辑 收藏
     摘要: QSqlQueryModel类为SQL的结果集提供了一个只读的数据模型,下面我们先利用这个类进行一个最简单的操作.
  阅读全文
posted @ 2011-11-22 15:16 再生的雄鹰| 编辑 收藏
     摘要: QT:数据库总结(一)
  阅读全文
posted @ 2011-11-19 17:38 再生的雄鹰 阅读(3533) | 评论 (1)编辑 收藏
QT笔记:QTableView控件
http://blog.csdn.net/reborntercel/article/details/6981478
posted @ 2011-11-17 14:15 再生的雄鹰 阅读(1397) | 评论 (0)编辑 收藏
     摘要: QT笔记:QObject::sender()的用法  阅读全文
posted @ 2011-11-17 13:36 再生的雄鹰 阅读(8143) | 评论 (0)编辑 收藏
     摘要: QT笔记:代理(Delegate)小结  阅读全文
posted @ 2011-11-17 11:25 再生的雄鹰 阅读(7209) | 评论 (0)编辑 收藏
     摘要: [原创]QT笔记:给QTableWidget添加自定义标题...待完善  阅读全文
posted @ 2011-11-16 15:56 再生的雄鹰 阅读(9639) | 评论 (0)编辑 收藏
     摘要: Qt下XML文档的读、写(DOM方式)  阅读全文
posted @ 2011-11-14 10:22 再生的雄鹰 阅读(9173) | 评论 (1)编辑 收藏
仅列出标题  

<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

常用链接

留言簿(1)

随笔档案

文章分类

文章档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜