parameters: (self, pe)
docstring: The difference of this routine vs. the `setImage' is, that the drawing
          does not include a difference analysis between the old and the new
          image. Instead, the internal image is used and the painting bound by the
          PaintEvent box.
docstring_summary: The difference of this routine vs. the `setImage' is, that the drawing
          does not include a difference analysis between the old and the new
          image. Instead, the internal image is used and the painting bound by the
          PaintEvent box.
docstring_tokens: The difference of this routine vs . the setImage is that the drawing does not include a difference analysis between the old and the new image . Instead the internal image is used and the painting bound by the PaintEvent box .
function: def paintEvent(self, pe):
          """
          The difference of this routine vs. the `setImage' is, that the drawing
          does not include a difference analysis between the old and the new
          image. Instead, the internal image is used and the painting bound by the
          PaintEvent box.
          """
          pm = self.paletteBackgroundPixmap()
          self.setUpdatesEnabled(False)
          paint = qt.QPainter()
          paint.begin(self)
          paint.setBackgroundMode(self.TransparentMode)
          # Note that the actual widget size can be slightly larger
          # that the image (the size is truncated towards the smaller
          # number of characters in `resizeEvent'. The paint rectangle
          # can thus be larger than the image, but less then the size
          # of one character.
          rect = pe.rect().intersect(self.contentsRect())
          tL  = self.contentsRect().topLeft()
          tLx = tL.x()
          tLy = tL.y()
          lux = min(self.columns-1, max(0, (rect.left()   - tLx - self.bX) / self.font_w))
          luy = min(self.lines-1,   max(0, (rect.top()    - tLy - self.bY) / self.font_h))
          rlx = min(self.columns-1, max(0, (rect.right()  - tLx - self.bX) / self.font_w))
          rly = min(self.lines-1,   max(0, (rect.bottom() - tLy - self.bY) / self.font_h))
          image = self._image
          for y in xrange(luy, rly+1):
              c = image[y][lux].c
              x = lux
              if not c and x:
                  x -= 1 # Search for start of multi-col char
              while x <= rlx:
                  disstrU = []
                  ca = image[y][x]
                  c = ca.c
                  if c:
                      disstrU.append(c)
                  cf = ca.f
                  cb = ca.b
                  cr = ca.r
                  xlen = 1
                  while (x+xlen <= rlx and
                         image[y][x+xlen].f == cf and
                         image[y][x+xlen].b == cb and
                         image[y][x+xlen].r == cr):
                      c = image[y][x+xlen].c
                      if c:
                          disstrU.append(c)
                      xlen += 1
                  if (x+xlen < self.columns) and (not image[y][x+xlen].c):
                      xlen += 1 # Adjust for trailing part of multi-column char
                  unistr = qt.QString(u''.join(disstrU))
                  self.drawAttrStr(paint,
                                   qt.QRect(self.bX+tLx+self.font_w*x, self.bY+tLy+self.font_h*y, self.font_w*xlen, self.font_h),
                                   unistr, ca, pm != None, False)
                  x += xlen
          self.drawFrame(paint)
          paint.end()
          self.setUpdatesEnabled(True)
function_tokens: def paintEvent ( self , pe ) : pm = self . paletteBackgroundPixmap ( ) self . setUpdatesEnabled ( False ) paint = qt . QPainter ( ) paint . begin ( self ) paint . setBackgroundMode ( self . TransparentMode ) # Note that the actual widget size can be slightly larger # that the image (the size is truncated towards the smaller # number of characters in `resizeEvent'. The paint rectangle # can thus be larger than the image, but less then the size # of one character. rect = pe . rect ( ) . intersect ( self . contentsRect ( ) ) tL = self . contentsRect ( ) . topLeft ( ) tLx = tL . x ( ) tLy = tL . y ( ) lux = min ( self . columns - 1 , max ( 0 , ( rect . left ( ) - tLx - self . bX ) / self . font_w ) ) luy = min ( self . lines - 1 , max ( 0 , ( rect . top ( ) - tLy - self . bY ) / self . font_h ) ) rlx = min ( self . columns - 1 , max ( 0 , ( rect . right ( ) - tLx - self . bX ) / self . font_w ) ) rly = min ( self . lines - 1 , max ( 0 , ( rect . bottom ( ) - tLy - self . bY ) / self . font_h ) ) image = self . _image for y in xrange ( luy , rly + 1 ) : c = image [ y ] [ lux ] . c x = lux if not c and x : x -= 1 # Search for start of multi-col char while x <= rlx : disstrU = [ ] ca = image [ y ] [ x ] c = ca . c if c : disstrU . append ( c ) cf = ca . f cb = ca . b cr = ca . r xlen = 1 while ( x + xlen <= rlx and image [ y ] [ x + xlen ] . f == cf and image [ y ] [ x + xlen ] . b == cb and image [ y ] [ x + xlen ] . r == cr ) : c = image [ y ] [ x + xlen ] . c if c : disstrU . append ( c ) xlen += 1 if ( x + xlen < self . columns ) and ( not image [ y ] [ x + xlen ] . c ) : xlen += 1 # Adjust for trailing part of multi-column char unistr = qt . QString ( u'' . join ( disstrU ) ) self . drawAttrStr ( paint , qt . QRect ( self . bX + tLx + self . font_w * x , self . bY + tLy + self . font_h * y , self . font_w * xlen , self . font_h ) , unistr , ca , pm != None , False ) x += xlen self . drawFrame ( paint ) paint . end ( ) self . setUpdatesEnabled ( True )