• 6015阅读
  • 5回复

qt复制一个区域 [复制链接]

上一主题 下一主题
离线lzpmail
 
只看楼主 倒序阅读 楼主  发表于: 2011-04-25
大家好, 请问qt下有没有复制一个区域的函数
离线XChinux

只看该作者 1楼 发表于: 2011-04-25
再描述清楚一些。
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
离线lzpmail
只看该作者 2楼 发表于: 2011-04-25
复制一个内存区域, 然后把这个区域映射到显示器上
离线XChinux

只看该作者 3楼 发表于: 2011-04-25
grabWindow, grabWidget,先想办法获取你要截取的窗口的图像,然后再将里面的一部分(QRect)截取出来就行了。
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
离线lzpmail
只看该作者 4楼 发表于: 2011-04-25
哦, 好的, 谢了, 我现在还有一个小问题, 我想问下在什么时候调用update(), 是在当图形画好后, 还是调用update后再画图
离线lizhenneng

只看该作者 5楼 发表于: 2011-04-25
update()会产生paint事件,由于事件的产生,当qt返回主事件循环后,paintEvent()函数被调用来绘图,下面是QWidget的说明:
void QWidget::update () [slot]

Updates the widget unless updates are disabled or the widget is hidden.

This function does not cause an immediate repaint; instead it schedules a paint event for processing when Qt returns to the main event loop. This permits Qt to optimize for more speed and less flicker than a call to repaint() does.

Calling update() several times normally results in just one paintEvent() call.

Qt normally erases the widget's area before the paintEvent() call. If the Qt::WA_OpaquePaintEvent widget attribute is set, the widget is responsible for painting all its pixels with an opaque color.
快速回复
限100 字节
 
上一个 下一个