本文整理汇总了Python中AnyQt.QtCore.QRectF.moveTo方法的典型用法代码示例。如果您正苦于以下问题:Python QRectF.moveTo方法的具体用法?Python QRectF.moveTo怎么用?Python QRectF.moveTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnyQt.QtCore.QRectF
的用法示例。
在下文中一共展示了QRectF.moveTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: paintEvent
# 需要导入模块: from AnyQt.QtCore import QRectF [as 别名]
# 或者: from AnyQt.QtCore.QRectF import moveTo [as 别名]
def paintEvent(self, event):
# TODO: Use QPainter.drawPixmapFragments on Qt 4.7
opt = QStyleOption()
opt.initFrom(self)
pixmap = self.__shadowPixmap
shadow_rect = QRectF(opt.rect)
widget_rect = QRectF(self.widget().geometry())
widget_rect.moveTo(self.radius_, self.radius_)
left = top = right = bottom = self.radius_
pixmap_rect = QRectF(QPointF(0, 0), QSizeF(pixmap.size()))
# Shadow casting rectangle in the source pixmap.
pixmap_shadow_rect = pixmap_rect.adjusted(left, top, -right, -bottom)
source_rects = self.__shadowPixmapFragments(pixmap_rect,
pixmap_shadow_rect)
target_rects = self.__shadowPixmapFragments(shadow_rect, widget_rect)
painter = QPainter(self)
for source, target in zip(source_rects, target_rects):
painter.drawPixmap(target, pixmap, source)
painter.end()