Exemplo n.º 1
0
    def foo(self):
        fmt = QTextCharFormat()
        fmt.setObjectType(QAbstractTextDocumentLayoutTest.objectType)

        cursor = self.textEdit.textCursor()
        cursor.insertText(py3k.unichr(0xfffc), fmt)
        self.textEdit.setTextCursor(cursor)
        self.textEdit.close()
    def foo(self):
        fmt = QTextCharFormat()
        fmt.setObjectType(QAbstractTextDocumentLayoutTest.objectType)

        cursor = self.textEdit.textCursor()
        cursor.insertText(py3k.unichr(0xfffc), fmt)
        self.textEdit.setTextCursor(cursor)
        self.textEdit.close()
Exemplo n.º 3
0
    def generatePlotFormat(plot, width, height):
        picture = QPicture()
        qcpPainter = QCPPainter()
        qcpPainter.begin(picture)
        plot.toPainter(qcpPainter, width, height)
        qcpPainter.end()

        result = QTextCharFormat()
        result.setObjectType(MainWindow.QCPTextFormat)
        result.setProperty(MainWindow.QCPData, picture)
        return result