static PyObject *meth_QSyntaxHighlighter_setDocument(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        QTextDocument * a0;
        PyObject *a0Keep;
        QSyntaxHighlighter *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B@J8", &sipSelf, sipType_QSyntaxHighlighter, &sipCpp, &a0Keep, sipType_QTextDocument, &a0))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp->setDocument(a0);
            Py_END_ALLOW_THREADS

            sipKeepReference(sipSelf, -59, a0Keep);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_QSyntaxHighlighter, sipName_setDocument, NULL);

    return NULL;
}
Пример #2
0
QSAEditor::QSAEditor(QWidget *parent)
    : QTextEdit(parent), qsInterp(0)
{
    setLineWrapMode(NoWrap);
    QSyntaxHighlighter *hl = new QSASyntaxHighlighter(this);
    hl->setDocument(document());
    matcher = new ParenMatcher;
    connect(this, SIGNAL(cursorPositionChanged()), matcher, SLOT(matchFromSender()));
    // #### add completion entries from highlighter

    readSettings();
}