本文整理汇总了Python中PyQt4.QtGui.QTransform.reset方法的典型用法代码示例。如果您正苦于以下问题:Python QTransform.reset方法的具体用法?Python QTransform.reset怎么用?Python QTransform.reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QTransform
的用法示例。
在下文中一共展示了QTransform.reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: QTerminalWidget
# 需要导入模块: from PyQt4.QtGui import QTransform [as 别名]
# 或者: from PyQt4.QtGui.QTransform import reset [as 别名]
#.........这里部分代码省略.........
self._kbdfunc(76, True)
elif s == "~b": # F2 -> Run ESC M
self._kbdfunc(77, True)
elif s == "~c": # F3 -> Cmds ESC N
self._kbdfunc(78, True)
elif s == "~d": # F4 -> SST ESC P
self._kbdfunc(80, True)
elif s == "~e": # F5 -> -Line ESC I
self._kbdfunc(73, True)
elif s == "~f": # F6 -> LC ESC O
self._kbdfunc(79, True)
# elif s == "~g": # F7 -> Ctrl ESC S
# self._kbdfunc(83, True)
else:
pass
if (event.isAutoRepeat() and not text) :
time.sleep(0.05)
event.accept()
#
# internal methods
#
def _update_metrics(self):
fm = self.fontMetrics()
self._char_height = fm.height()
self._char_width = fm.width("W")
#
# update cursor position
#
def _update_cursor_rect(self):
if self._cursortype== CURSOR_OFF or (self._cursor_col== -1 and self._cursor_row==-1):
return
cx, cy = self._pos2pixel(self._cursor_col, self._cursor_row)
self._transform.reset()
self._transform.translate(cx,cy)
self._cursor_update=True
self._blink=True
#
# determine pixel position from rowl, column
#
def _pos2pixel(self, col, row):
x = (col * self._char_width)
y = row * self._char_height
return x, y
#
# paint cursor
#
def _paint_cursor(self, painter):
if self._cursortype== CURSOR_OFF or (self._cursor_col== -1 and self._cursor_row==-1):
return
#
# cursor position was updated initialize some variables
#
if self._cursor_update:
self._cursor_update= False
self._blink_brush=QBrush(self._cursor_color)
self._blink_pen=QPen(self._cursor_color)
self._blink_pen.setStyle(0)
if self._cursor_attr:
self._noblink_background_color = self._color_scheme[1]
self._noblink_foreground_color = self._color_scheme[0]
else:
self._noblink_background_color = self._color_scheme[0]
self._noblink_foreground_color = self._color_scheme[1]
self._noblink_brush = QBrush(self._noblink_background_color)
#