当前位置:网站首页>Qt中QTableView设置分页显示的三种方法[通俗易懂]
Qt中QTableView设置分页显示的三种方法[通俗易懂]
2022-07-28 13:45:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
1、已知所有数据的情况下,以MVC模式对数据进行分页处理: 参考链接:http://www.cnblogs.com/caomingongli/archive/2011/11/17/2252745.html 参考链接:https://blog.csdn.net/xujiali5172923/article/details/47835265
2、数据库很大的时候,QTableView会自动生成一个滑动条,通过设置滑动条的范围,设置页码 参考链接:https://blog.csdn.net/liuguangzhou123/article/details/8109089
3、如果是查询数据放入QTableView,可以通过更改查询条件的方式,分页显示,每次点击上一页/下一页就更新查询条件
model = new QSqlQueryModel(this);
model->setQuery(QString("select num,time,ion,temperature,humidity from data_net where time between '%1' and '%2'").arg(table_query_begin).arg(table_query_end));每次更改table_query_begin和table_query_end即可实现分页效果
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/128596.html原文链接:https://javaforall.cn
边栏推荐
- Super resolution reconstruction based on deep learning
- OKR and grad
- 8、 Picker usage drop-down box selection effect
- MySQL development skills - View
- RSA encrypts data with private key and decrypts data with public key (not a signature verification process)
- Iterator iterator interface
- 【七夕】七夕孤寡小青蛙究极版?七夕节最终章!
- Node文件操作
- Read how to deploy highly available k3s with external database
- Leetcode 105. construct binary tree from preorder and inorder traversal sequence & 106. construct binary tree from inorder and postorder traversal sequence
猜你喜欢

Hcip day 10

10、 Timestamp

草料二维码--在线二维码生成器
Excel VBA 开发过程中遇到的一些问题,解决方案,持续更新
![[线程安全问题] 多线程到底可能会带来哪些风险?](/img/79/112ab7e586b0bceb296dfddb2728be.png)
[线程安全问题] 多线程到底可能会带来哪些风险?

手机滚动截屏软件推荐

2022 low voltage electrician examination questions and answers

JMeter installation tutorial and login add token

如何只降3D相机不降UI相机的分辨率

2022 safety officer-a certificate operation certificate examination question bank simulated examination platform operation
随机推荐
Unittest executes runtestcase prompt <_ io. Textiowrapper name= '< stderr>' mode=W encoding=UTF-8 > solution
Alibaba, jd.com, Tiktok: push cloud to the heart of industry
九、uni-popup用法 下拉框底部弹窗效果
如何有效进行回顾会议(上)?
2022 high altitude installation, maintenance, removal of examination question bank and online simulated examination
HCIP第十二天
QT self-made soft keyboard is the most perfect and simple, just like its own virtual keyboard
开源项目丨Taier1.2版本发布,新增工作流、租户绑定简化等多项功能
RSA encrypts data with private key and decrypts data with public key (not a signature verification process)
Bulk Rename Utility
QML picture preview
2022低压电工考试题及答案
The default storage engine after MySQL 5.5 is InnoDB.
[ecmascript6] class
Mobile phone scrolling screenshot software recommendation
JS instantiation method
Daily question - Scholarship
Read how to deploy highly available k3s with external database
These three online PS tools should be tried
HCIP第十一天