当前位置:网站首页>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
边栏推荐
- zabbix分布式
- Clickhouse architecture and design
- Mobile phone scrolling screenshot software recommendation
- 利用反射构建一棵菜单生成树
- Tdengine helps Siemens' lightweight digital solutions
- 聊天室功能的实现
- How to effectively conduct the review meeting (Part 1)?
- C# 读取ini文件、键值对操作
- [ecmascript6] async and await
- Iterator iterator interface
猜你喜欢

用友BIP CRM新品发布,赋能大中型企业营销增长

Daily question - Scholarship

超好用的手机录屏软件推荐

2022 melting welding and thermal cutting examination questions and online simulation examination

HCIP第十天

As a programmer, how to manage time efficiently?

开源项目丨Taier1.2版本发布,新增工作流、租户绑定简化等多项功能

多所“双一流”大学,保研预报名启动!

2022 safety officer-a certificate operation certificate examination question bank simulated examination platform operation

Hcip day 11
随机推荐
Read how to deploy highly available k3s with external database
What is gossip (E-Net gossip)
Node file operation
Collaborative office tools: Online whiteboard is in its infancy, and online design has become a red sea
Why is it reverse to convert from other formats to BMP
HCIP第十一天
朗镜科技(Trax中国)“机器人+AI”开启中国零售元宇宙时代
Niuke multi school link with level editor i- (linear DP)
Afnetworking crash course
[ecmascript6] async and await
How to effectively conduct the review meeting (Part 1)?
Multi level cache scheme
Node文件操作
[线程安全问题] 多线程到底可能会带来哪些风险?
2022年熔化焊接与热切割考题及在线模拟考试
如何只降3D相机不降UI相机的分辨率
Development and definition of software testing
[server data recovery] HP StorageWorks series server RAID5 offline data recovery of two disks
Using reflection to build a menu spanning tree
Database optimization understanding these is enough