コード例 #1
0
ファイル: mdichild.cpp プロジェクト: manasdas17/uve
MdiChild::MdiChild()
{
    setAttribute(Qt::WA_DeleteOnClose);
    isUntitled = true;
    forceClose = false;
    saveAndClose = false;
    lexer = 0;

    setAutoIndent(true);
    setMarginLineNumbers(1,true);
    setFolding(QsciScintilla::BoxedFoldStyle);
    setMarginType(1, QsciScintilla::NumberMargin);
    setMarginWidth(1,"00000");
    setAutoCompletionSource(QsciScintilla::AcsDocument);
    setAutoCompletionThreshold(2);
}
コード例 #2
0
/**
 * Initializes the lexer.
 * @param script
 *      The script file.
 */
void SingleDocument::initLexer(QString script)
{
    (void)script;

    if(lexer() == 0)
    {
        setLexer(new QsciLexerJavaScript(this));
        QsciAPIs* apis = new QsciAPIs(lexer());
        (void)apis;


        setAutoCompletionSource(QsciScintilla::AcsAPIs);
        setAutoCompletionCaseSensitivity(true);
        setAutoCompletionThreshold(3);
        setAutoIndent(true);
        setIndentationWidth(4);
        setTabWidth(4);
        setMarginLineNumbers(0,true);
        setMarginType(0, QsciScintilla::NumberMargin);
        setMarginsForegroundColor(QColor(128, 128, 128));
       }

}
コード例 #3
0
    QSourceCodeWidget::QSourceCodeWidget( int _index, const char * fname, const char * srcTxt ) : QsciScintilla ( 0 ) {

        index      = _index;
        long_name  = QString(fname);
        short_name = QFileInfo(long_name).fileName();

        QFont font(tr("Courier New"));
        font.setPointSize(8);

        setLexer(new QsciLexerCPP);
        lexer()->setFont(font);

        setText( QString(srcTxt) );
        setReadOnly(true);

        setFolding(QsciScintilla::BoxedTreeFoldStyle);

        setMarginType(1,QsciScintilla::NumberMargin);
        setMarginWidth(1,30);
        setMarginSensitivity(1,true);

        current_marker=0;

    }