找回密码
 立即注册
收起左侧

Qt做一个文本编辑器实现类似于word的分页机制

2
回复
7961
查看
[复制链接]
累计签到:1 天
连续签到:1 天
来源: 2017-4-17 20:38:28 显示全部楼层 |阅读模式
1Qter豆
当用QTextEdit接受输入内容时,当文本长度大于空间的高度,
QTextEdit会自动使用一个滚动条,使控件能够接受文本内容,
但是我现在想实现一个类似于word稿纸的功能,当稿纸内容填满后,
能够再次分配一张稿纸,即QTextEdit接受一定的内容后,不允许再次
输入内容,这样我可以捕获事件再次分配一个控件接受信息

回复

使用道具 举报

累计签到:2 天
连续签到:1 天
2017-8-14 17:33:02 显示全部楼层
不知道打印预览那种能不能满足你的要求
回复

使用道具 举报

累计签到:2 天
连续签到:1 天
2017-8-14 17:35:30 显示全部楼层
fga333 发表于 2017-8-14 17:33
不知道打印预览那种能不能满足你的要求

Qprinter  newpage
When QPainter::begin() is called, the QPrinter it operates on is prepared for a new page, enabling the QPainter to be used immediately to paint the first page in a document. Once the first page has been painted, newPage() can be called to request a new blank page to paint on, or QPainter::end() can be called to finish printing. The second page and all following pages are prepared using a call to newPage() before they are painted.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

公告
可以关注我们的微信公众号yafeilinux_friends获取最新动态,或者加入QQ会员群进行交流:190741849、186601429(已满) 我知道了