最新资讯

  • 文本编辑控件QScintilla动态库二次开发

文本编辑控件QScintilla动态库二次开发

2026-01-28 16:39:17 栏目:最新资讯 1 阅读

        使用的开源QScintilla_src-2.14.1版本32位。资源自己网上下。

        二次开发了关键字,补全,折叠,光标,任意位置换行等功能。效果图如下:

        

代码如下:

CustomLexer.h

#include "../Depends/QScintilla_src-2.14.1/src/Qsci/qscilexercustom.h"
#include "../Depends/QScintilla_src-2.14.1/src/Qsci/qsciscintilla.h"
#include "../Depends/QScintilla_src-2.14.1/src/Qsci/qscilexer.h"

class CustomLexer : public QsciLexerCustom
{
public:
    explicit CustomLexer(QObject* parent = nullptr);

    // 必须重写的核心方法
    const char* language() const override;
    QString description(int style) const override;
    void styleText(int start, int end) override;
    void fold(int& foldLevel, int style);  // 关键折叠逻辑

    // 可选重写方法(样式控制)
    QColor defaultColor(int style) const override;
    QFont defaultFont(int style) const override;

    // 关键字管理
    void setKeywords(const QStringList& kwds);
    const QStringList& keywords() const { return m_keywords; }

    QString splitLineInfo(QString str);

private:
    QStringList m_keywords;
    int m_keywordStyle;
    int m_foldStartStyle;
    int m_foldEndStyle;
    int m_Level;
};

CustomLexer.cpp

#include "CustomLexer.h"
#include 

CustomLexer::CustomLexer(QObject* parent)
    : QsciLexerCustom(parent)
{
    // 定义关键字列表(含折叠标记关键字)
    m_keywords = QStringList({ "func", "var", "return", "endfunc" });
    m_keywordStyle = 1;    // 关键字基础样式
    m_foldStartStyle = 2;  // 折叠起始样式(如 "begin")
    m_foldEndStyle = 3;    // 折叠结束样式(如 "end")
    m_Level = 1;
}

const char* CustomLexer::language() const {
    return "MyCustomLang";  // 自定义语言名称
}

QString CustomLexer::description(int style) const {
    switch (style) {
    case 0: return "Default";
    case 1: return "Keyword";
    case 2: return "String";
        // 添加更多样式描述...
    default: return "";
    }
}

QString CustomLexer::splitLineInfo(QString str)
{
    QString n_str = "";
    if (str.contains("
"))
    {
        QStringList n_list = str.split("
");
        n_str = n_list.at(0);
        return n_str;
    }
    else
        return str;
}

void CustomLexer::styleText(int start, int end)
{
    if (!editor()) return;

    //QsciStyler styler(this);
    QString text = editor()->text(start, end);
    for (int pos = 0; pos < text.length(); )
    {
        startStyling(start + pos);
        setStyling(1, 0);  // 默认样式
        pos++;
        continue;
    }
    //QString n_str = splitLineInfo(text);
    //qDebug() << "n_str:" << n_str;
    qDebug() << "styleText:" << text << ";start;" << start << ";end;" << end;
    //int n_currentPos = editor()->SendScintilla(QsciScintilla::SCI_GETCURRENTPOS);
    //int n_currentLine = editor()->SendScintilla(QsciScintilla::SCI_LINEFROMPOSITION, n_currentPos);
    //qDebug() << "styleText::n_currentLine:" << n_currentLine << ";n_currentPos:" << n_currentPos;

    // 遍历文本应用样式
    for (int pos = 0; pos < text.length(); ) {
        if (text[pos].isSpace()) {
            startStyling(start + pos);
            setStyling(1, 0);  // 默认样式
            pos++;
            continue;
        }

        // 检测关键字
        bool isKeyword = false;
        foreach(const QString & kw, m_keywords) {
            ////qDebug() <<"pos:" << pos <<";kw.length():"<< kw.length() << ";test:" << text.mid(pos, kw.length());
            if (text.mid(pos, kw.length()) == kw) {
                ////qDebug() << "gjz in........................";
                startStyling(start + pos);
                //setStyling(kw.length(), 1);  // 关键字样式
            if (kw == "func")
                {
                    int currentPos = editor()->SendScintilla(QsciScintilla::SCI_GETCURRENTPOS);
                    int currentLine = editor()->SendScintilla(QsciScintilla::SCI_LINEFROMPOSITION, currentPos);
                    //int foldLevel = editor()->SendScintilla(QsciScintilla::SCI_GETFOLDLEVEL, 2);

                    ////qDebug() << "func::currentLine:" << currentLine << ";currentPos:" << currentPos;
                    ////qDebug() << "func::m_Level:" << m_Level;
                    //qDebug() << "line:" << start + pos;
                    //editor()->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, currentLine, QsciScintilla::SC_FOLDLEVELHEADERFLAG);
                    //editor()->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, currentLine, QsciScintilla::SC_FOLDLEVELBASE | QsciScintilla::SC_FOLDLEVELHEADERFLAG | m_Level);

                    setStyling(kw.length(), m_foldStartStyle);  // 标记为折叠起始
                    //////editor()->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, currentLine, QsciScintilla::SC_FOLDLEVELHEADERFLAG | m_Level);
                    //////m_Level++;

                }
                else if (kw == "endfunc")
                {
                    int currentPos = editor()->SendScintilla(QsciScintilla::SCI_GETCURRENTPOS);
                    int currentLine = editor()->SendScintilla(QsciScintilla::SCI_LINEFROMPOSITION, currentPos);
                    ////qDebug() << "endfunc::currentLine:" << currentLine << ";currentPos:" << currentPos;
                    ////qDebug() << "endfunc::m_Level:" << m_Level;

                    setStyling(kw.length(), m_foldEndStyle);  // 标记为折叠结束
                    //m_Level--;
                    //editor()->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, currentLine, m_Level);
                }
                else
                    setStyling(kw.length(), m_keywordStyle);  // 关键字样式
                pos += kw.length();
                isKeyword = true;
                break;
            }
        }
        if (!isKeyword && pos < text.length()) {
            pos++;
        }

        //if (isKeyword) continue;

        //// 检测字符串(示例:双引号包裹)
        //if (text[pos] == '"') {
        //    int endPos = text.indexOf('"', pos + 1);
        //    if (endPos == -1) endPos = text.length();
        //    startStyling(start + pos);
        //    setStyling(endPos - pos + 1, 2);  // 字符串样式
        //    pos = endPos + 1;
        //    continue;
        //}


        // 默认处理
        //startStyling(start + pos);
        //setStyling(1, 0);
        //pos++;
    }


}
QColor CustomLexer::defaultColor(int style) const {
    switch (style) {
    case 1: return Qt::blue;     // 关键字颜色
    case 2: return Qt::darkGreen; // 字符串颜色
    default: return Qt::black;   // 默认颜色
    }
}

QFont CustomLexer::defaultFont(int style) const {
    QFont font("Consolas", 10);
    if (style == 1) font.setBold(true);  // 关键字加粗
    return font;
}
void CustomLexer::setKeywords(const QStringList& kwds)
{
    m_keywords = kwds;
}

void CustomLexer::fold(int& foldLevel, int style) {
    if (style == 1) {  // 遇到 '{'
        foldLevel |= QsciScintilla::SC_FOLDLEVELHEADERFLAG;
        foldLevel++;
    }
    else if (style == 2) {  // 遇到 '}'
        foldLevel--;
    }
}

SCLWidget.h

#ifndef SCLWIDGET_H
#define SCLWIDGET_H
#include "qsciscintilla.h"
#include "qscilexercpp.h"
#include "qscilexercustom.h"
#include "qsciapis.h"

#include "CustomLexer.h"
#include "BodorPLC_global.h"

#include 
#include 
#include 
#include 


class SCLWidget : public QWidget
{
    Q_OBJECT

public:
    explicit SCLWidget(QWidget* parent = nullptr);
    bool eventFilter(QObject* obj, QEvent* ev) override;
private slots:
    void handleTextChanged();
private:
    void checkUpdateLineInfo(int curLine);
private:
    QsciScintilla* editor;
    QStringList m_keywords;//关键字
    QList foldedLines;//中间换行的下边行List留痕
    bool m_isNewLine;//是否是换行回车
    CURCURSOR m_curCursor;//换行回车光标留痕
};

#endif // SCLWIDGET_H


SCLWidget.cpp

#include "SCLWidget.h"
#include 
#include 
#include 
SCLWidget::SCLWidget(QWidget* parent)
    : QWidget(parent)
{
    m_keywords = QStringList({ "func", "var", "return", "endfunc","endvar" });
    m_isNewLine = false;
    foldedLines = {};
    m_curCursor = { 0,0 };

    QVBoxLayout* mainLayout = new QVBoxLayout(this);
    editor = new QsciScintilla(this);
    mainLayout->addWidget(editor);
    editor->installEventFilter(this);
    connect(editor, SIGNAL(textChanged()),
        this, SLOT(handleTextChanged()), Qt::QueuedConnection);
    // 配置编辑器基础属性
    editor->setMarginLineNumbers(1, true);  // 显示行号
    editor->setMarginWidth(1, "0000");      // 行号栏宽度
    editor->setAutoIndent(true);            // 自动缩进

    // 应用自定义词法分析器
    CustomLexer* lexer = new CustomLexer(editor);
    editor->setLexer(lexer);
    //关键字补全
    QsciAPIs* pyApis = new QsciAPIs(lexer);
    pyApis->add("func");
    pyApis->add("fuaa");
    pyApis->add("var");
    pyApis->add("varq");
    pyApis->add("return");
    pyApis->add("returnq");
    pyApis->add("endfunc");
    pyApis->add("endvar");
    pyApis->prepare();

    editor->setAutoCompletionSource(QsciScintilla::AcsAPIs);  // 仅使用 API 列表
    editor->setAutoCompletionCaseSensitivity(true);           // 区分大小写
    editor->setAutoCompletionThreshold(1);                    // 输入1个字符触发补全
    editor->setAutoCompletionFillupsEnabled(true);            // 允许补全填充

    // 启用折叠
    editor->setFolding(QsciScintilla::BoxedTreeFoldStyle);
    editor->setFoldMarginColors(Qt::lightGray, Qt::white);
    // 设置折叠边栏(通常为第2边栏)
    editor->setMarginWidth(2, 16);  // 宽度建议16-20像素
    editor->setMarginType(2, QsciScintilla::SymbolMargin);
    editor->setMarginSensitivity(2, true);  // 允许点击交互
    // 定义折叠展开(+)和折叠(-)的符号
    editor->markerDefine(QsciScintilla::RightTriangle, QsciScintilla::SC_MARKNUM_FOLDEROPEN);  // 展开状态
    editor->markerDefine(QsciScintilla::Minus, QsciScintilla::SC_MARKNUM_FOLDER);             // 折叠状态

    // 将编辑器设为中心部件
    //setCentralWidget(editor);
    //resize(800, 600);
}

void SCLWidget::handleTextChanged()
{
    qDebug() << "handleTextChanged in.................................................";
    //QString n_str = splitLineInfo(text);
    //qDebug() << "n_str:" << n_str;
    //qDebug() << "styleText:" << text<<";start;"<< start << ";end;" << end;
    //获知当前行
    int n_currentPos = editor->SendScintilla(QsciScintilla::SCI_GETCURRENTPOS);
    int n_currentLine = editor->SendScintilla(QsciScintilla::SCI_LINEFROMPOSITION, n_currentPos);
    qDebug() << "styleText::n_currentLine:" << n_currentLine << ";n_currentPos:" << n_currentPos;

    // 获取行文本
    int start = editor->SendScintilla(QsciScintilla::SCI_POSITIONFROMLINE, n_currentLine);
    int end = editor->SendScintilla(QsciScintilla::SCI_GETLINEENDPOSITION, n_currentLine);
    QString n_str = editor->text(start, end);
    qDebug() << "handleTextChanged::str:" << n_str;

    //获取折叠层级
    int foldLevel = editor->SendScintilla(QsciScintilla::SCI_GETFOLDLEVEL, n_currentLine);
    int levelNum = foldLevel & QsciScintilla::SC_FOLDLEVELNUMBERMASK; // 提取层级数值
    qDebug() << "foldLevel:" << foldLevel;
    qDebug() << "levelNum:" << levelNum;
    for (int line = 0; line < editor->lines(); ++line) {
        int aa_foldLevel = editor->SendScintilla(QsciScintilla::SCI_GETFOLDLEVEL, line);
        int aa_levelNum = aa_foldLevel & QsciScintilla::SC_FOLDLEVELNUMBERMASK; // 提取层级数值
        qDebug() << "line:" << line << ";aa_foldLevel:" << aa_foldLevel << ";levelNum:" << aa_levelNum;
    }
    
    //新增行重新更新下面行折叠层级
    //折叠分级逻辑
    if (m_isNewLine)//换行回车
    {
        m_isNewLine = false;
        //新增行更新折叠层级
        if (m_curCursor.col == 0)//行首
        {
            editor->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, n_currentLine - 1, 1024 + levelNum - 1);
        }
        else if (m_curCursor.col == m_curCursor.len)//行尾
        {
            int n_foldLevel_1 = editor->SendScintilla(QsciScintilla::SCI_GETFOLDLEVEL, n_currentLine - 1);
            int n_levelNum_1 = n_foldLevel_1 & QsciScintilla::SC_FOLDLEVELNUMBERMASK;
            if (n_foldLevel_1 > 8192)
                editor->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, n_currentLine, 1024 + n_levelNum_1);
            else if (n_foldLevel_1 < 1024)
                editor->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, n_currentLine, 1024 + n_levelNum_1 - 1);
            else
                editor->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, n_currentLine, n_foldLevel_1);
        }
        else//行中
        {
            int n_foldLevel_2 = editor->SendScintilla(QsciScintilla::SCI_GETFOLDLEVEL, n_currentLine - 1);
            int n_levelNum_2 = n_foldLevel_2 & QsciScintilla::SC_FOLDLEVELNUMBERMASK;
            if (n_foldLevel_2 > 8192 || n_foldLevel_2 < 1024)
            {
                //两个都要检查
                if (n_foldLevel_2 > 8192)
                    editor->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, n_currentLine - 1, 1024 + n_levelNum_2 - 1);
                else
                    editor->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, n_currentLine - 1, 1024 + n_levelNum_2);
                checkUpdateLineInfo(n_currentLine - 1);
                int n_foldLevel_3 = editor->SendScintilla(QsciScintilla::SCI_GETFOLDLEVEL, n_currentLine - 1);
                int n_levelNum_3 = n_foldLevel_3 & QsciScintilla::SC_FOLDLEVELNUMBERMASK;
                if (n_foldLevel_3 > 8192)
                    editor->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, n_currentLine, 1024 + n_levelNum_3);
                else if (n_foldLevel_3 < 1024)
                    editor->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, n_currentLine, 1024 + n_levelNum_3 - 1);
                else
                    editor->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, n_currentLine, n_foldLevel_3);
                checkUpdateLineInfo(n_currentLine);
            }
            else
            {
                //检查第二个就行了
                editor->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, n_currentLine, n_foldLevel_2);
                checkUpdateLineInfo(n_currentLine);
            }
        }

        /*if (foldLevel > 8192)
            editor->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, n_currentLine + 1, 1024 + levelNum);
        else if (foldLevel < 1024)
            editor->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, n_currentLine + 1, 1024 + levelNum - 1);
        else
            editor->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, n_currentLine + 1, foldLevel);*/

            //新增行重新更新下面行折叠层级
        for (int i = n_currentLine + 2; i < editor->lines(); i++)
        {
            editor->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, i, foldedLines[i - 1]);
        }
    }
    else {
        for (int pos = 0; pos < n_str.length(); ) {
            if (n_str[pos].isSpace())
            {
                pos++;
                continue;
            }
            foreach(const QString & kw, m_keywords) {
                if (n_str.mid(pos, kw.length()) == kw) {
                    if (kw == "func")
                    {
                        int func_foldLevel = editor->SendScintilla(QsciScintilla::SCI_GETFOLDLEVEL, n_currentLine);
                        int func_levelNum = func_foldLevel & QsciScintilla::SC_FOLDLEVELNUMBERMASK; // 提取层级数值
                        qDebug() << "func_foldLevel1:" << func_foldLevel;
                        qDebug() << "func_levelNum1:" << func_levelNum;
                        int n_level = func_levelNum;

                        if (func_foldLevel < 8192)
                        {
                            if (func_foldLevel >= 1024)
                                n_level = func_foldLevel - 1024 + 1;
                            else
                                n_level = func_foldLevel;
                            editor->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, n_currentLine, QsciScintilla::SC_FOLDLEVELHEADERFLAG | n_level);
                            /*editor->insertAt("
", n_currentLine, 4);
                            editor->insertAt("endfunc", n_currentLine+1,0);
                            editor->setCursorPosition(n_currentLine+1, 7);
                            editor->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, n_currentLine+1, n_level);*/
                            qDebug() << "gggggggg:" << editor->lines();
                        }
                        else
                        {
                            editor->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, n_currentLine, QsciScintilla::SC_FOLDLEVELHEADERFLAG | n_level);
                        }

                        qDebug() << "func:n_level:" << n_level;
                        func_foldLevel = editor->SendScintilla(QsciScintilla::SCI_GETFOLDLEVEL, n_currentLine);
                        func_levelNum = func_foldLevel & QsciScintilla::SC_FOLDLEVELNUMBERMASK; // 提取层级数值
                        qDebug() << "func_foldLevel2:" << func_foldLevel;
                        qDebug() << "func_levelNum2:" << func_levelNum;
                    }
                    else if (kw == "endfunc")
                    {
                        int func_foldLevel = editor->SendScintilla(QsciScintilla::SCI_GETFOLDLEVEL, n_currentLine);
                        int func_levelNum = func_foldLevel & QsciScintilla::SC_FOLDLEVELNUMBERMASK; // 提取层级数值
                        qDebug() << "endfunc_foldLevel1:" << func_foldLevel;
                        qDebug() << "endfunc_levelNum1:" << func_levelNum;
                        int n_level = levelNum;
                        if (foldLevel >= 1024)
                        {
                            if (foldLevel < 8192)
                            {
                                if (foldLevel == 1024)
                                {
                                    n_level = 0;
                                    //提示结构错误
                                }
                                else
                                    n_level = foldLevel - 1024;
                            }
                        }
                        editor->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, n_currentLine, n_level);
                        int end_foldLevel = editor->SendScintilla(QsciScintilla::SCI_GETFOLDLEVEL, n_currentLine);
                        int end_levelNum = end_foldLevel & QsciScintilla::SC_FOLDLEVELNUMBERMASK; // 提取层级数值
                        qDebug() << "end_foldLevel:" << end_foldLevel;
                        qDebug() << "end_levelNum:" << end_levelNum;
                    }
                    pos += kw.length();
                    break;
                }
            }
            if (pos < n_str.length()) {
                pos++;
            }
        }
    }
}

bool SCLWidget::eventFilter(QObject* obj, QEvent* ev)
{
    if (obj == editor && ev->type() == QEvent::KeyPress)
    {
        QKeyEvent* keyEvent = static_cast(ev);
        if (keyEvent->key() == Qt::Key_Return) {
            if (editor->SendScintilla(QsciScintilla::SCI_AUTOCACTIVE))//补全
            {
                qDebug() << "bu quan de hui che";
                int n_currentPos = editor->SendScintilla(QsciScintilla::SCI_GETCURRENTPOS);
                int n_currentLine = editor->SendScintilla(QsciScintilla::SCI_LINEFROMPOSITION, n_currentPos);
                int func_foldLevel = editor->SendScintilla(QsciScintilla::SCI_GETFOLDLEVEL, n_currentLine);
                int func_levelNum = func_foldLevel & QsciScintilla::SC_FOLDLEVELNUMBERMASK; // 提取层级数值

                qDebug() << "huiche_n_currentLine:" << n_currentLine;
                qDebug() << "huiche_foldLevel:" << func_foldLevel;
                qDebug() << "huiche_levelNum:" << func_levelNum;
            }
            else//换行
            {
                qDebug() << "huan hang de hui cheeeeeeeeeeeeeeeeeeeeeeeeeeee";
                int n_currentPos = editor->SendScintilla(QsciScintilla::SCI_GETCURRENTPOS);
                int n_currentLine = editor->SendScintilla(QsciScintilla::SCI_LINEFROMPOSITION, n_currentPos);
                qDebug() << "n_currentLine:" << n_currentLine << "test:" << editor->text(n_currentLine);
                QString n_str = editor->text(n_currentLine);
                while (n_str.endsWith("
") || n_str.endsWith("
")) {
                    n_str.chop(1);  // 逐个移除末尾的
或

                }
                m_curCursor.len = n_str.size();

                editor->getCursorPosition(&m_curCursor.row, &m_curCursor.col);
                qDebug() << "m_curCursor.row:" << m_curCursor.row << ";m_curCursor.col:" << m_curCursor.col << ";m_curCursor.len:" << m_curCursor.len;

                foldedLines.clear();
                for (int line = 0; line < editor->lines(); ++line) {
                    int func_foldLevel = editor->SendScintilla(QsciScintilla::SCI_GETFOLDLEVEL, line);
                    int func_levelNum = func_foldLevel & QsciScintilla::SC_FOLDLEVELNUMBERMASK; // 提取层级数值
                    qDebug() << "line:" << line << ";foldLevel:" << func_foldLevel << ";levelNum:" << func_levelNum;
                    foldedLines.append(func_foldLevel);
                }
                m_isNewLine = true;

            }
        }
    }
    return false;
}

//当前行
void SCLWidget::checkUpdateLineInfo(int curLine)
{
    // 获取行文本
    int start = editor->SendScintilla(QsciScintilla::SCI_POSITIONFROMLINE, curLine);
    int end = editor->SendScintilla(QsciScintilla::SCI_GETLINEENDPOSITION, curLine);
    QString n_str = editor->text(start, end);
    //获取折叠层级
    int foldLevel = editor->SendScintilla(QsciScintilla::SCI_GETFOLDLEVEL, curLine);
    int levelNum = foldLevel & QsciScintilla::SC_FOLDLEVELNUMBERMASK; // 提取层级数值
    for (int pos = 0; pos < n_str.length(); ) {
        if (n_str[pos].isSpace())
        {
            pos++;
            continue;
        }

        foreach(const QString & kw, m_keywords) {
            if (n_str.mid(pos, kw.length()) == kw) {
                if (kw == "func")
                {
                    int n_level = levelNum;
                    if (foldLevel < 8192)
                    {
                        if (foldLevel >= 1024)
                            n_level = foldLevel - 1024 + 1;
                        else
                            n_level = foldLevel;
                    }
                    editor->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, curLine, QsciScintilla::SC_FOLDLEVELHEADERFLAG | n_level);
                }
                else if (kw == "endfunc")
                {
                    int n_level = levelNum;
                    if (foldLevel >= 1024)
                    {
                        if (foldLevel < 8192)
                        {
                            if (foldLevel == 1024)
                            {
                                n_level = 0;
                                //提示结构错误
                            }
                            else
                                n_level = foldLevel - 1024;
                        }
                        /*else
                            n_level = */

                    }
                    editor->SendScintilla(QsciScintilla::SCI_SETFOLDLEVEL, curLine, n_level);
                }
                pos += kw.length();
                break;
            }
        }
        if (pos < n_str.length()) {
            pos++;
        }
    }
}
                   
          

本文地址:https://www.yitenyun.com/469.html

搜索文章

Tags

#ios面试 #ios弱网 #断点续传 #ios开发 #objective-c #ios #ios缓存 #服务器 #python #pip #conda #远程工作 香港站群服务器 多IP服务器 香港站群 站群服务器 #kubernetes #笔记 #平面 #容器 #linux #学习方法 #运维 #fastapi #html #css #进程控制 #docker #后端 #数据库 #低代码 #爬虫 #音视频 #cpolar #开发语言 #云原生 #iventoy #VmWare #OpenEuler #人工智能 #node.js #MobaXterm #ubuntu #Conda # 私有索引 # 包管理 #开源 #RTP over RTSP #RTP over TCP #RTSP服务器 #RTP #TCP发送RTP #android #腾讯云 #c# #内网穿透 #网络 #tcp/ip #多个客户端访问 #IO多路复用 #回显服务器 #TCP相关API #web安全 #学习 #安全 #kylin #Trae #IDE #AI 原生集成开发环境 #Trae AI #数信院生信服务器 #Rstudio #生信入门 #生信云服务器 #物联网 #websocket #vscode #mobaxterm #深度学习 #计算机视觉 #华为 #ModelEngine #金融 #大模型 #mcp #金融投资Agent #Agent #n8n #本地部署 #windows #hadoop #hbase #hive #zookeeper #spark #kafka #flink #qt #C++ #我的世界服务器搭建 #minecraft #java #jar #nginx #claude #github #vue.js #前端 #vue #阿里云 #JumpServer #堡垒机 #振镜 #振镜焊接 #云计算 #DisM++ # GLM-4.6V # 系统维护 #京东云 #gpu算力 #算法 #SRS #流媒体 #直播 #我的世界 #守护进程 #复用 #screen #unity3d #游戏 #服务器框架 #Fantasy #umeditor粘贴word #ueditor粘贴word #ueditor复制word #ueditor上传word图片 #http #c++ #性能优化 #ssh #缓存 #mamba #智能手机 #MCP #todesk #unity #游戏引擎 #jenkins #需求分析 #scala #测试用例 #测试工具 #压力测试 #Dell #PowerEdge620 #内存 #硬盘 #RAID5 #MCP服务器 #面试 #NPU #CANN #centos #gemini #gemini国内访问 #gemini api #gemini中转搭建 #Cloudflare #智能路由器 #5G #pycharm #运维开发 #mysql #C2000 #TI #实时控制MCU #架构 #AI服务器电源 #mvp #个人开发 #设计模式 #单元测试 #集成测试 #stm32 #udp #嵌入式硬件 #ide #编辑器 #git #大数据 #搜索引擎 #网络协议 #DeepSeek #蓝耘智算 #Anaconda配置云虚拟环境 #Nacos #web #微服务 #RustDesk #IndexTTS 2.0 #本地化部署 #毕业设计 #车辆排放 #ms-swift # 大模型 # 模型训练 #Android #Bluedroid #PyTorch # Triton # 高并发部署 #java-ee #sql #golang #rdp #科技 #自然语言处理 #神经网络 #libosinfo #Dify #ARM架构 #鲲鹏 #EMC存储 #存储维护 #NetApp存储 #SSH反向隧道 # Miniconda # Jupyter远程访问 #c语言 #自动化 #NAS #Termux #Samba #Linux #单片机 #php #apache #risc-v #flask #GPU服务器 #8U #硬件架构 #vnstat #监控 #AI编程 #spring boot #课程设计 #微信小程序 #小程序 #microsoft #opencv #数据挖掘 #Qwen3-14B # 大模型部署 # 私有化AI #screen 命令 #macos #AI 推理 #NV #文心一言 #AI智能体 #pytorch #vp9 #攻防演练 #Java web #漏洞 #红队 #leetcode #职场和发展 #黑群晖 #虚拟机 #无U盘 #纯小白 #支付 #数据结构 #gitlab #1024程序员节 #SSH跳板机 # Python3.11 #fpga开发 #LVDS #高速ADC #DDR #东方仙盟 #API限流 # 频率限制 # 令牌桶算法 #chrome #华为云 #screen命令 #jvm #排序算法 #Gunicorn #WSGI #Flask #并发模型 #容器化 #Python #性能调优 #蓝湖 #Axure原型发布 #gitea #经验分享 #机器人 #门禁 #梯控 #智能一卡通 #门禁一卡通 #消费一卡通 #智能梯控 #一卡通 #源代码管理 #超时设置 #客户端/服务器 #网络编程 #C# #YOLO # 目标检测 #管道Pipe #system V #ai #ai编程 #AIGC #YOLO26 #目标检测 #SAP #ebs #metaerp #oracle ebs #javascript #uv #uvx #uv pip #npx #Ruff #pytest #react native #react.js #910B #昇腾 #ida #web server #请求处理流程 #交通物流 #C语言 #vivado license #CVE-2025-68143 #CVE-2025-68144 #CVE-2025-68145 #网络安全 #SSH # 批量管理 #语音识别 #ASR #SenseVoice #星图GPU #中间件 #MQTT协议 #智能体 #ONLYOFFICE #MCP 服务器 #laravel #ssl #tomcat #asp.net #prometheus #grafana #svn #证书 #scrapy #serverless #RAID #RAID技术 #磁盘 #存储 # 双因素认证 # TensorFlow #服务器繁忙 #AI #蓝牙 #LE Audio #BAP #postgresql #连接数据库报错 #链表 #cursor #puppeteer #oracle #adb #国产化 #elasticsearch #安全威胁分析 #仙盟创梦IDE #YOLOFuse # Base64编码 # 多模态检测 #硬件工程 #智能家居 #动态规划 #负载均衡 #pyqt #xlwings #Excel #DNS #dlms #dlms协议 #逻辑设备 #逻辑设置间权限 #bug菌问答团队 #nfs #iscsi #SPA #单页应用 #django #web3.py #redis #C #spring cloud #spring #Spring AI #STDIO传输 #SSE传输 #WebMVC #WebFlux #bootstrap #transformer #prompt #大模型学习 #麒麟OS #文件管理 #文件服务器 #信息与通信 #信号处理 #tcpdump #swagger #visual studio code #debian #mariadb #树莓派4b安装系统 #LangGraph #CLI #JavaScript #langgraph.json #paddleocr #wsl #jdk #排序 #ddos #银河麒麟高级服务器操作系统安装 #银河麒麟高级服务器V11配置 #设置基础软件仓库时出错 #银河麒高级服务器系统的实操教程 #生产级部署银河麒麟服务系统教程 #Linux系统的快速上手教程 #系统架构 #工具集 #分布式 #KMS激活 #计算机网络 #sqlite #numpy #CSDN #数据仓库 #电气工程 #PLC #微信 #wordpress #雨云 #LobeChat #vLLM #GPU加速 #海外服务器安装宝塔面板 #翻译 #开源工具 #maven #intellij-idea #ansible #jmeter #功能测试 #软件测试 #自动化测试 #大模型部署 #mindie #大模型推理 #创业创新 #业界资讯 #openlayers #bmap #tile #server #milvus #langchain #大模型开发 #程序员 #CosyVoice3 # 语音合成 #机器学习 #chatgpt #Puppet # IndexTTS2 # TTS #说话人验证 #声纹识别 #CAM++ #codex #x86_64 #数字人系统 #windows11 #系统修复 #三维 #3D #三维重建 #信令服务器 #Janus #MediaSoup #其他 #rtsp #转发 #unix #rust #SQL注入主机 #json #webrtc #idm #ping通服务器 #读不了内网数据库 #万悟 #联通元景 #镜像 #大模型教程 #AI大模型 #mcu #ThingsBoard MCP #数据分析 #推荐算法 #devops #客户端 #健身房预约系统 #健身房管理系统 #健身管理系统 #shell #渗透测试 #黑客技术 #计算机 #文件上传漏洞 #bug #密码学 #HeyGem # 服务器IP访问 # 端口映射 #A2A #GenAI #遛狗 #聊天小程序 #心理健康服务平台 #心理健康系统 #心理服务平台 #心理健康小程序 #鸭科夫 #逃离鸭科夫 #鸭科夫联机 #鸭科夫异地联机 #开服 #北京百思可瑞教育 #百思可瑞教育 #北京百思教育 # 一锤定音 # 大模型微调 #nodejs #vllm #cpp #项目 #高并发 #ffmpeg #CUDA #Triton #交互 #练习 #基础练习 #数组 #循环 #九九乘法表 #计算机实现 #dynadot #域名 #esb接口 #走处理类报异常 #dify #部署 #语言模型 #昇腾300I DUO #fiddler #银河麒麟部署 #银河麒麟部署文档 #银河麒麟linux #银河麒麟linux部署教程 #串口服务器 #Modbus #IFix #VibeVoice # 高温监控 #c++20 # PyTorch # 远程连接 #fs7TF #Buck #NVIDIA #算力 #交错并联 #DGX #ROS # 局域网访问 # 批量处理 #内存治理 #cosmic #googlecloud #https #uni-app #H5 #跨域 #发布上线后跨域报错 #请求接口跨域问题解决 #跨域请求代理配置 #request浏览器跨域 #gerrit #opc ua #opc #deepseek #npu #Miniconda # 环境迁移 #大剑师 #nodejs面试题 #matplotlib #AutoDL #安全架构 #内网 #iBMC #UltraISO # WebUI # 网络延迟 #银河麒麟 #系统升级 #信创 #指针 #anaconda #虚拟环境 #GB28181 #SIP信令 #SpringBoot #视频监控 #远程软件 #WT-2026-0001 #QVD-2026-4572 #smartermail #电脑 #游戏机 # GLM-TTS # 数据安全 #xshell #host key #驱动开发 #UDP的API使用 #TTS私有化 # IndexTTS # 音色克隆 #ESP32 # OTA升级 # 黄山派 #代理服务器 #rsync # 数据同步 #ip #bash #arm开发 #Modbus-TCP #blender #设计师 #图像处理 #游戏美术 #技术美术 # ARM服务器 # 大模型推理 # Connection refused #系统管理 #服务 #teamviewer #Emby #视频 #微PE # GLM # 服务连通性 #azure #Apple AI #Apple 人工智能 #FoundationModel #Summarize #SwiftUI #LLM #大语言模型 #llama #ceph #ambari #arm #多线程 # CUDA #claudeCode #content7 #跳槽 #工作 #挖矿 #Linux病毒 #turn #sql注入 #网安应急响应 #odoo #数据恢复 #视频恢复 #视频修复 #RAID5恢复 #流媒体服务器恢复 #Ubuntu #aws #哈希算法 #远程开发 #muduo库 # 高并发 #appche #版本控制 #Git入门 #开发工具 #代码托管 #SSH跳转 #TTS #openEuler #go # GPU集群 #Gateway #认证服务器集成详解 #服务器开启 TLS v1.2 #IISCrypto 使用教程 #TLS 协议配置 #IIS 安全设置 #服务器运维工具 #ftp #sftp #uniapp #合法域名校验出错 #服务器域名配置不生效 #request域名配置 #已经配置好了但还是报错 #uniapp微信小程序 #框架搭建 #YOLO识别 #YOLO环境搭建Windows #YOLO环境搭建Ubuntu #状态模式 #AI-native #dba #LangFlow # 轻量化镜像 # 边缘计算 #Tokio #操作系统 #国产化OS #华为od #华为机试 #Java #OpenHarmony #springboot #知识库 #制造 #能源 #汽车 #cpu #rocketmq #Socket #套接字 #I/O多路复用 #字节序 #jupyter #html5 #weston #x11 #x11显示服务器 #研发管理 #禅道 #禅道云端部署 #WinSCP 下载安装教程 #SFTP #FTP工具 #服务器文件传输 #计算几何 #斜率 #方向归一化 #叉积 #Ansible # CosyVoice3 # 批量部署 #samba #RSO #机器人操作系统 #glibc #媒体 #远程连接 #PN 结 #openHiTLS #TLCP #DTLCP #商用密码算法 #后端框架 #服务器线程 # SSL通信 # 动态结构体 #RWK35xx #语音流 #实时传输 #node #嵌入式 #超算中心 #PBS #lsf #excel #报表制作 #职场 #数据可视化 #信息可视化 #用数据讲故事 #zabbix #手机h5网页浏览器 #安卓app #苹果ios APP #手机电脑开启摄像头并排查 #深度优先 #DFS #语音生成 #集成学习 #selenium #fabric #AI写作 #可信计算技术 #winscp #AI部署 # ms-swift #前端框架 #嵌入式编译 #ccache #distcc #.net #JNI #CPU #pxe #测评 #CCE #Dify-LLM #Flexus #lvs # 数字人系统 # 远程部署 #毕设 #STUN # TURN # NAT穿透 #MCP服务器注解 #异步支持 #方法筛选 #声明式编程 #自动筛选机制 #rustdesk #p2p #可再生能源 #绿色算力 #风电 #麦克风权限 #访问麦克风并录制音频 #麦克风录制音频后在线播放 #用户拒绝访问麦克风权限怎么办 #uniapp 安卓 苹果ios #将音频保存本地或上传服务器 #Docker #express #cherry studio #Node.js # child_process #free #vmstat #sar #KMS #slmgr #宝塔面板部署RustDesk #RustDesk远程控制手机 #手机远程控制 #铁路桥梁 #DIC技术 #箱梁试验 #裂纹监测 #四点弯曲 #r语言 #mybatis #spine #若依 #TRO #TRO侵权 #TRO和解 #运维工具 #GLM-4.6V-Flash-WEB # AI视觉 # 本地部署 #网络攻击模型 #进程 #进程创建与终止 #harmonyos #Discord机器人 #云部署 #程序那些事 #AI应用编程 # 自动化运维 #移动端h5网页 #调用浏览器摄像头并拍照 #开启摄像头权限 #拍照后查看与上传服务器端 #摄像头黑屏打不开问题 #企业微信 #3d #服务器IO模型 #非阻塞轮询模型 #多任务并发模型 #异步信号模型 #多路复用模型 #系统安全 #ipmitool #BMC # 黑屏模式 # TTS服务器 #前端开发 #EN4FE #ollama #llm #领域驱动 #自由表达演说平台 #演说 #程序员创富 #YOLOv8 # Docker镜像 #文件IO #输入输出流 #流程图 #论文阅读 #论文笔记 #图论 #国产开源制品管理工具 #Hadess #一文上手 #蓝桥杯 #工业级串口服务器 #串口转以太网 #串口设备联网通讯模块 #串口服务器选型 #okhttp #embedding #IndexTTS2 # 阿里云安骑士 # 木马查杀 #范式 #入侵 #日志排查 #kmeans #聚类 #Karalon #AI Test #人大金仓 #Kingbase #小艺 #鸿蒙 #搜索 #代理模式 #Spring AOP #程序人生 #健康医疗 #AI应用 #图像识别 #多进程 #python技巧 #高考 #企业级存储 #网络设备 #iot #软件工程 #生信 #word #pdf #Smokeping #工程实践 #STDIO协议 #Streamable-HTTP #McpTool注解 #服务器能力 #策略模式 #pve #GPU #租显卡 #训练推理 #java大文件上传 #java大文件秒传 #java大文件上传下载 #java文件传输解决方案 #wps #Linux多线程 #bigtop #hdp #hue #kerberos #pencil #pencil.dev #设计 #zotero #WebDAV #同步失败 #时序数据库 #轻量化 #低配服务器 #Beidou #北斗 #SSR #Anything-LLM #IDC服务器 #私有化部署 #国产操作系统 #麒麟 #V11 #kylinos #大模型应用 #API调用 #PyInstaller打包运行 #服务端部署 #raid #raid阵列 #DIY机器人工房 #gpt #API #taro #软件 #本地生活 #电商系统 #商城 #高级IO #poll #PyCharm # 远程调试 # YOLOFuse #Playbook #AI服务器 #欧拉 #simulink #matlab #journalctl #epoll #aiohttp #asyncio #异步 #信息安全 #信息收集 #Langchain-Chatchat # 国产化服务器 # 信创 #Syslog #系统日志 #日志分析 #日志监控 #生产服务器问题查询 #日志过滤 #Autodl私有云 #深度服务器配置 # 水冷服务器 # 风冷服务器 #.netcore #VoxCPM-1.5-TTS # 云端GPU # PyCharm宕机 #儿童AI #图像生成 #Qwen #pjsip #LoRA # lora-scripts # 模型微调 #openresty #lua #智能体来了 #传统行业 #AI赋能 #AI生成 # outputs目录 # 自动化 #挖漏洞 #攻击溯源 #编程 #stl #漏洞修复 #IIS Crypto #warp #SSH保活 # GLM-4.6V-Flash-WEB # AI部署 #everything #材料工程 #数码相机 #智能电视 #人脸识别sdk #视频编解码 #人脸识别 #VMware创建虚拟机 #远程更新 #缓存更新 #多指令适配 #物料关联计划 #m3u8 #HLS #移动端H5网页 #APP安卓苹果ios #监控画面 直播视频流 #Prometheus #esp32 arduino #决策树 #Zabbix #语音合成 #HistoryServer #Spark #YARN #jobhistory #二值化 #Canny边缘检测 #轮廓检测 #透视变换 #DooTask #ZooKeeper #ZooKeeper面试题 #面试宝典 #深入解析 #Clawdbot #ComfyUI # 推理服务器 #防毒面罩 #防尘面罩 #n8n解惑 #编程助手 #net core #kestrel #web-server #asp.net-core #elk #rabbitmq # 显卡驱动备份 #模拟退火算法 #计算机毕业设计 #程序定制 #毕设代做 #课设 #源码 #VMware #简单数论 #埃氏筛法 #Hadoop #TCP #postman #内存接口 # 澜起科技 # 服务器主板 #大模型入门 #flutter #homelab #Lattepanda #Jellyfin #Plex #Kodi #yolov12 #研究生life #开关电源 #热敏电阻 #PTC热敏电阻 #文件传输 #电脑文件传输 #电脑传输文件 #电脑怎么传输文件到另一台电脑 #电脑传输文件到另一台电脑 #身体实验室 #健康认知重构 #系统思维 #微行动 #NEAT效应 #亚健康自救 #ICT人 #eureka #云服务器 #个人电脑 #KMS 激活 #mongodb #wireshark #广播 #组播 #并发服务器 #nacos #银河麒麟aarch64 #MC #MC群组服务器 #yum #uvicorn #uvloop #asgi #event # 服务器迁移 # 回滚方案 #BoringSSL #企业存储 #RustFS #对象存储 #高可用 #notepad++ #es安装 #远程控制 #云计算运维 #asp.net大文件上传 #asp.net大文件上传下载 #asp.net大文件上传源码 #ASP.NET断点续传 #asp.net上传文件夹 #asp.net上传大文件 #gpu #nvcc #cuda #nvidia #漏洞挖掘 #TensorRT # 推理优化 #SSH别名 #CS2 #debian13 #log4j #Jetty # 嵌入式服务器 #模块 #ICE #信创国产化 #达梦数据库 #CVE-2025-61686 #路径遍历高危漏洞 #RXT4090显卡 #RTX4090 #深度学习服务器 #硬件选型 #群晖 #音乐 # 鲲鹏 #IntelliJ IDEA #Spring Boot #neo4j #NoSQL #SQL #http头信息 #Llama-Factory #Coturn #TURN #ci/cd #k8s # 代理转发 # 跳板机 #echarts #鸿蒙PC ##租显卡 #树莓派 #温湿度监控 #WhatsApp通知 #IoT #MySQL # 服务器IP # 端口7860 #建筑缺陷 #红外 #数据集 #结构体 #TCP服务器 #开发实战 #SMARC #ARM #全文检索 #银河麒麟服务器系统 #远程桌面 #可撤销IBE #服务器辅助 #私钥更新 #安全性证明 #双线性Diffie-Hellman # 公钥认证 #Reactor #Kylin-Server #服务器安装 #Android16 #音频性能实战 #音频进阶 #短剧 #短剧小程序 #短剧系统 #微剧 # 智能运维 # 性能瓶颈分析 # GPU租赁 # 自建服务器 #空间计算 #原型模式 #hibernate #nosql # 云服务器 #无人机 #戴尔服务器 #戴尔730 #装系统 #junit #新人首发 #web服务器 #I/O模型 #并发 #水平触发、边缘触发 #多路复用 #sqlserver #clickhouse #代理 #企业开发 #ERP #项目实践 #.NET开发 #C#编程 #数据访问 #编程与数学 #DHCP #网络安全大赛 #C++ UA Server #SDK #Windows #跨平台开发 #eclipse #servlet #arm64 #CNAS #CMA #程序文件 #SSH复用 # 远程开发 #磁盘配额 #存储管理 #形考作业 #国家开放大学 #系统运维 #IO #GATT服务器 #蓝牙低功耗 #lucene #DAG #云服务器选购 #Saas #线程 #散列表 #机器视觉 #6D位姿 #UOS #海光K100 #统信 #outlook #错误代码2603 #无网络连接 #2603 #mssql #数据安全 #注入漏洞 #wpf #实时检测 #卷积神经网络 #MOXA #密码 #firefox #safari # RTX 3090 #具身智能 #SSH密钥 #SSH公钥认证 # 安全加固 # ControlMaster #ETL管道 #RAG #向量存储 #数据预处理 #DocumentReader #硬件 #Fun-ASR # 语音识别 #HarmonyOS APP #windbg分析蓝屏教程 #AI电商客服 #le audio #低功耗音频 #通信 #连接 #spring ai #oauth2 #nmodbus4类库使用教程 #docker-compose #目标跟踪 #rtmp #PowerBI #企业 # 远程访问 #Streamlit #AI聊天机器人 #tensorflow #ui # 树莓派 # ARM架构 #memcache #飞牛nas #fnos #ansys #ansys问题解决办法 #银河麒麟操作系统 #openssh #华为交换机 #信创终端 #处理器 #分布式数据库 #集中式数据库 #业务需求 #选型误 #智能体对传统行业冲击 #行业转型 #HarmonyOS #雨云服务器 #Minecraft服务器 #教程 #MCSM面板 #Socket网络编程 #chat #muduo #TcpServer #accept #高并发服务器 # 服务器配置 # GPU # 串口服务器 # NPort5630 #Python办公自动化 #Python办公 #工程设计 #预混 #扩散 #燃烧知识 #层流 #湍流 #量子计算 #copilot #个人博客 #硬盘克隆 #DiskGenius # 键鼠锁定 #mtgsig #美团医药 #美团医药mtgsig #美团医药mtgsig1.2 #反向代理 #政务 #参数估计 #矩估计 #概率论 #adobe #powerbi #select #MinIO #gmssh #宝塔 #1panel #Exchange #sentinel #系统安装 #scikit-learn #随机森林 #静脉曲张 #腿部健康 #运动 #POC #问答 #交付 #AI Agent #开发者工具 #Minecraft #PaperMC #我的世界服务器 #边缘AI # Kontron # SMARC-sAMX8 #jetty #kong #Kong Audio #Kong Audio3 #KongAudio3 #空音3 #空音 #中国民乐 #计算机外设 #ET模式 #非阻塞 #remote-ssh #SA-PEKS # 关键词猜测攻击 # 盲签名 # 限速机制 #scanf #printf #getchar #putchar #cin #cout #OpenAI #故障 #优化 #多模态 #微调 #超参 #LLamafactory #产品经理 #就业 #vps #docker安装seata # IndexTTS 2.0 #全链路优化 #实战教程 #database #idea #AI论文写作工具 #学术写作辅助 #论文创作效率提升 #AI写论文实测 #数字化转型 #实体经济 #商业模式 #软件开发 #数智红包 #商业变革 #创业干货 #AB包 #sglang #Go并发 #高并发架构 #Goroutine #系统设计 #Tracker 服务器 #响应最快 #torrent 下载 #2026年 #Aria2 可用 #迅雷可用 #BT工具通用 #交换机 #三层交换机 #SSH Agent Forwarding # 容器化 #高斯溅射 #UEFI #BIOS #Legacy BIOS #eBPF #云开发 #性能 #RAM #Harbor #AI智能棋盘 #Rock Pi S #边缘计算 #C/C++ #c++高并发 #百万并发 # 权限修复 #uip # HiChatBox # 离线AI #X11转发 #SMTP # 内容安全 # Qwen3Guard #VMWare Tool #MinIO服务器启动与配置详解 #改行学it #平板 #零售 #智能硬件 #vncdotool #链接VNC服务器 #如何隐藏光标 #CTF #gateway #Comate #agent #ai大模型 #FHSS #Deepoc #具身模型 #开发板 #未来 #自动化运维 #插件 #开源软件 #NFC #智能公交 #服务器计费 #FP-增长 #算力建设 #b树 #Proxmox VE #虚拟化 #memory mcp #Cursor #smtp #smtp服务器 #PHP #intellij idea #声源定位 #MUSIC