ChinaUnix.net
相关文章推荐:

QSqlTableModel与QTableView

我自己实现了一个list继承自qtableview model也是自己实现的 现在有个问题就是当我用鼠标点击单元格开始编辑的时候,里面内容自动被清空了,这不是我要的,我要的是点击后该单元格虽然可以编辑,但也不清空里面的内容阿 请高手指点 多谢

by picobsd - GUI编程 - 2010-09-13 21:54:33 阅读(3513) 回复(0)

相关讨论

qtableview 复选框 图标 合并单元格 我现在使用一个qtableview显示数据,需要在第一列显示一个图标和复选框, 显示图标时,我使用 QStandardItem ( const QIcon & icon, const QString & text ) 运行时提示: QPixmap: It is not safe to use pixmaps outside the GUI thread 还有就是如何同一行上的多个单元格, 用setSpan()不起作用? 这个函数如何使用?

by creatory - GUI编程 - 2009-12-29 11:25:32 阅读(5241) 回复(0)

十五.设置qtableview中列宽 tableViewCustomer->setColumnWidth(0, 60); tableViewCustomer->setColumnWidth(1, 55); tableViewCustomer->setColumnWidth(2, 70); tableViewCustomer->setColumnWidth(3, 50); tableViewCustomer->setColumnWidth(4, 80); tableViewCustomer->setColumnWidth(5, 80); tableViewCustomer->setColumnWidth(6, 70); tableViewCustomer->setColumnWidth(7, 100); tableViewCustomer->setColu...

by flyfish520 - Linux文档专区 - 2007-04-27 20:29:29 阅读(973) 回复(0)

十四.获取qtableview中鼠标选择行信息 QModelIndex index = tableViewCustomer->currentIndex(); 然后通过queryModelCustomer.record(index.row()).value("customerid")可获得选择行在数据库中的相关信息(queryModelCustomer为tableViewCustomer中setModel(&queryModelCustome)设置的QSqlQueryModel 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/37292/showart_287666.html

by flyfish520 - Linux文档专区 - 2007-04-27 20:28:29 阅读(1077) 回复(0)

十三. 在qtableview中设置点击各标题排序 queryModelGoods.sort(0); QHeaderView *headerGoods = tableViewGoods->horizontalHeader(); //SortIndicator为水平标题栏文字旁边的三角指示器 headerGoods->setSortIndicator(0, Qt::AscendingOrder); headerGoods->setSortIndicatorShown(true); headerGoods->setClickable(true); connect(headerGoods, SIGNAL(sectionClicked(int)), tableViewGoods, SLOT (sortByColumn(int))); ...

by flyfish520 - Linux文档专区 - 2007-04-27 20:26:33 阅读(919) 回复(0)