MCPcopy Create free account
hub / github.com/Bitmessage/PyBitmessage / lazyRender

Method lazyRender

src/bitmessageqt/messageview.py:93–110  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

91# QtGui.QTextBrowser.loadResource(restype, name)
92
93 def lazyRender(self):
94 if self.rendering:
95 return
96 self.rendering = True
97 position = self.verticalScrollBar().value()
98 cursor = QtGui.QTextCursor(self.document())
99 while self.outpos < len(self.out) and self.verticalScrollBar().value() >= self.document().size().height() - 2 * self.size().height():
100 startpos = self.outpos
101 self.outpos += 10240
102 # find next end of tag
103 if self.mode == MessageView.MODE_HTML:
104 pos = self.out.find(">", self.outpos)
105 if pos > self.outpos:
106 self.outpos = pos + 1
107 cursor.movePosition(QtGui.QTextCursor.End, QtGui.QTextCursor.MoveAnchor)
108 cursor.insertHtml(QtCore.QString(self.out[startpos:self.outpos]))
109 self.verticalScrollBar().setValue(position)
110 self.rendering = False
111
112 def showPlain(self):
113 self.mode = MessageView.MODE_PLAIN

Callers 2

showPlainMethod · 0.95
showHTMLMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected