统一修改编码为utf8-bom

This commit is contained in:
爬山虎 2023-02-12 21:52:31 +08:00
parent c8c0a8be8b
commit ab92d95baf
96 changed files with 438 additions and 688 deletions

View File

@ -1,4 +1,4 @@
#include "CmpareMode.h" #include "CmpareMode.h"
#include "Encode.h" #include "Encode.h"
#include "rcglobal.h" #include "rcglobal.h"

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <qobject.h> #include <qobject.h>
#include<QVector> #include<QVector>
#include<QMap> #include<QMap>

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <algorithm> #include <algorithm>
#include <utility> #include <utility>
#include <random> #include <random>

View File

@ -1,4 +1,4 @@
#include "aboutndd.h" #include "aboutndd.h"
AboutNdd::AboutNdd(QWidget *parent) AboutNdd::AboutNdd(QWidget *parent)
: QWidget(parent) : QWidget(parent)

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QWidget> #include <QWidget>
#include "ui_aboutndd.h" #include "ui_aboutndd.h"

View File

@ -1,4 +1,4 @@
#include "batchfindreplace.h" #include "batchfindreplace.h"
#include "scintillaeditview.h" #include "scintillaeditview.h"
#include "ccnotepad.h" #include "ccnotepad.h"
#include "progresswin.h" #include "progresswin.h"
@ -31,7 +31,7 @@ void BatchFindReplace::setTabWidget(QTabWidget* editTabWidget)
m_editTabWidget = editTabWidget; m_editTabWidget = editTabWidget;
} }
//自动调整当前窗口的状态,如果发生了变化,则需要认定为是首次查找 //自动调整当前窗口的状态,如果发生了变化,则需要认定为是首次查找
QWidget* BatchFindReplace::autoAdjustCurrentEditWin() QWidget* BatchFindReplace::autoAdjustCurrentEditWin()
{ {
QWidget* pw = m_editTabWidget->currentWidget(); QWidget* pw = m_editTabWidget->currentWidget();
@ -53,7 +53,7 @@ void BatchFindReplace::appendToFindTable(QString findKeyword)
ui.findReplaceTable->setItem(rNum, 1, new QTableWidgetItem()); ui.findReplaceTable->setItem(rNum, 1, new QTableWidgetItem());
} }
//这里不能追加而是插入即对应的Item必须已经存在。否则不插入 //这里不能追加而是插入即对应的Item必须已经存在。否则不插入
void BatchFindReplace::insertToReplaceTable(int row, QString replaceKeyword) void BatchFindReplace::insertToReplaceTable(int row, QString replaceKeyword)
{ {
QTableWidgetItem* item = ui.findReplaceTable->item(row, 1); QTableWidgetItem* item = ui.findReplaceTable->item(row, 1);
@ -97,11 +97,11 @@ void BatchFindReplace::appendToFindReplaceTable(QStringList& findKeyword)
bool BatchFindReplace::tranInputKeyword(QString& findKeyWord, QStringList& outputKeyWordList) bool BatchFindReplace::tranInputKeyword(QString& findKeyWord, QStringList& outputKeyWordList)
{ {
//把空白字符,空格或者\t \r\n 等字符进行替换为空格 //把空白字符,空格或者\t \r\n 等字符进行替换为空格
QRegExp re("\\s"); QRegExp re("\\s");
findKeyWord.replace(re, QString(" ")); findKeyWord.replace(re, QString(" "));
//再进行空格分隔处理 //再进行空格分隔处理
outputKeyWordList = findKeyWord.split(" "); outputKeyWordList = findKeyWord.split(" ");
if (outputKeyWordList.size() > 20000) if (outputKeyWordList.size() > 20000)
@ -110,7 +110,7 @@ bool BatchFindReplace::tranInputKeyword(QString& findKeyWord, QStringList& outpu
return false; return false;
} }
//删除每一个空的元素 //删除每一个空的元素
for (int i = outputKeyWordList.size() - 1; i >= 0; --i) for (int i = outputKeyWordList.size() - 1; i >= 0; --i)
{ {
if (outputKeyWordList[i].trimmed().isEmpty()) if (outputKeyWordList[i].trimmed().isEmpty())
@ -166,7 +166,7 @@ void BatchFindReplace::on_freshBtClick()
} }
} }
//进行批量查找工作 //进行批量查找工作
void BatchFindReplace::on_findBtClick() void BatchFindReplace::on_findBtClick()
{ {
if (m_mainNotepad != nullptr && m_mainNotepad) if (m_mainNotepad != nullptr && m_mainNotepad)
@ -213,7 +213,7 @@ void BatchFindReplace::on_findBtClick()
} }
} }
//进行批量替换工作 //进行批量替换工作
void BatchFindReplace::on_replaceBtClick() void BatchFindReplace::on_replaceBtClick()
{ {
if (m_mainNotepad != nullptr && m_mainNotepad) if (m_mainNotepad != nullptr && m_mainNotepad)
@ -306,9 +306,9 @@ void BatchFindReplace::on_import()
QFileDialog fd(this, QString(), CCNotePad::s_lastOpenDirPath); QFileDialog fd(this, QString(), CCNotePad::s_lastOpenDirPath);
fd.setFileMode(QFileDialog::ExistingFile); fd.setFileMode(QFileDialog::ExistingFile);
if (fd.exec() == QDialog::Accepted) //如果成功的执行 if (fd.exec() == QDialog::Accepted) //如果成功的执行
{ {
QStringList fileNameList = fd.selectedFiles(); //返回文件列表的名称 QStringList fileNameList = fd.selectedFiles(); //返回文件列表的名称
QFileInfo fi(fileNameList[0]); QFileInfo fi(fileNameList[0]);
QSettings setting(fi.filePath(), QSettings::IniFormat); QSettings setting(fi.filePath(), QSettings::IniFormat);

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QMainWindow> #include <QMainWindow>
#include <QTabWidget> #include <QTabWidget>

View File

@ -1,4 +1,4 @@
#include "bigfilemessage.h" #include "bigfilemessage.h"
BigFileMessage::BigFileMessage(QWidget *parent) BigFileMessage::BigFileMessage(QWidget *parent)
: QDialog(parent), m_result(-1) : QDialog(parent), m_result(-1)

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include "ccnotepad.h" #include "ccnotepad.h"
#include <QWidget> #include <QWidget>

View File

@ -1,4 +1,4 @@
#include <memory> #include <memory>
#include "ccnotepad.h" #include "ccnotepad.h"
#include "filemanager.h" #include "filemanager.h"
#include "Encode.h" #include "Encode.h"

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QMainWindow> #include <QMainWindow>
#include <QLabel> #include <QLabel>

View File

@ -1,4 +1,4 @@
#include "filemanager.h" #include "filemanager.h"
#include "scintillaeditview.h" #include "scintillaeditview.h"
#include "scintillahexeditview.h" #include "scintillahexeditview.h"
#include "CmpareMode.h" #include "CmpareMode.h"

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include "common.h" #include "common.h"
#include "rcglobal.h" #include "rcglobal.h"
@ -11,7 +11,7 @@
class ScintillaEditView; class ScintillaEditView;
class ScintillaHexEditView; class ScintillaHexEditView;
//小于100k的文件一次性全部读取完毕 //小于100k的文件一次性全部读取完毕
const int LITTLE_FILE_MAX = 1024000; const int LITTLE_FILE_MAX = 1024000;
enum ERROR_TYPE { enum ERROR_TYPE {
@ -29,16 +29,16 @@ struct NewFileIdMgr {
} }
}; };
//管理二进制文件的信息 //管理二进制文件的信息
struct HexFileMgr { struct HexFileMgr {
QString filePath; QString filePath;
QFile* file; QFile* file;
qint64 fileOffset; qint64 fileOffset;
qint64 fileSize; qint64 fileSize;
qint16 lineSize;//每次读取多少行默认为64行没行16个字符 qint16 lineSize;//每次读取多少行默认为64行没行16个字符
char* contentBuf; char* contentBuf;
int contentRealSize; int contentRealSize;
bool onetimeRead; //是否一次性全部读取到内存。小于等于LITTLE_FILE_MAX的才会全部读取 bool onetimeRead; //是否一次性全部读取到内存。小于等于LITTLE_FILE_MAX的才会全部读取
HexFileMgr() :file(nullptr), fileOffset(0), lineSize(64), fileSize(0), contentBuf(nullptr), contentRealSize(0),onetimeRead(false) HexFileMgr() :file(nullptr), fileOffset(0), lineSize(64), fileSize(0), contentBuf(nullptr), contentRealSize(0),onetimeRead(false)
{ {
@ -62,17 +62,17 @@ private:
HexFileMgr(const HexFileMgr&) = delete; HexFileMgr(const HexFileMgr&) = delete;
}; };
//管理大文本文件的信息 //管理大文本文件的信息
struct TextFileMgr { struct TextFileMgr {
QString filePath; QString filePath;
QFile* file; QFile* file;
qint64 fileOffset; qint64 fileOffset;
qint64 fileSize; qint64 fileSize;
qint16 lineSize;//每次读取多少行默认每次读取1024行。但是最大不超过1M的内容。 qint16 lineSize;//每次读取多少行默认每次读取1024行。但是最大不超过1M的内容。
char* contentBuf; char* contentBuf;
int contentRealSize; int contentRealSize;
int loadWithCode; int loadWithCode;
int lineEndType;//行尾类型win linux mac int lineEndType;//行尾类型win linux mac
TextFileMgr() :file(nullptr), fileOffset(0), lineSize(64), fileSize(0), contentBuf(nullptr), contentRealSize(0), loadWithCode(CODE_ID::UNKOWN),lineEndType(RC_LINE_FORM::UNKNOWN_LINE) TextFileMgr() :file(nullptr), fileOffset(0), lineSize(64), fileSize(0), contentBuf(nullptr), contentRealSize(0), loadWithCode(CODE_ID::UNKOWN),lineEndType(RC_LINE_FORM::UNKNOWN_LINE)
{ {
@ -98,23 +98,23 @@ private:
}; };
struct BlockIndex { struct BlockIndex {
qint64 fileOffset;//块的开始地址 qint64 fileOffset;//块的开始地址
quint32 fileSize;//块的大小 quint32 fileSize;//块的大小
quint32 lineNumStart;//块中行号的开始值 quint32 lineNumStart;//块中行号的开始值
quint32 lineNum;//块中的行数量 quint32 lineNum;//块中的行数量
}; };
//管理大文本文件,可以编辑的信息 //管理大文本文件,可以编辑的信息
struct BigTextEditFileMgr { struct BigTextEditFileMgr {
QString filePath; QString filePath;
QFile* file; QFile* file;
uchar* filePtr;//使用的是文件映射的方式打开 uchar* filePtr;//使用的是文件映射的方式打开
quint32 m_curBlockIndex; //当前展示中的块索引序号 quint32 m_curBlockIndex; //当前展示中的块索引序号
int loadWithCode; //以何种编码来加载解析文件。默认UTF8 int loadWithCode; //以何种编码来加载解析文件。默认UTF8
int lineEndType;//行尾类型win linux mac int lineEndType;//行尾类型win linux mac
static const qint16 BLOCK_SIZE = 1;//块大小单位M。开始是4M发现块越大行越多那么在一块中定位行的位置越慢 static const qint16 BLOCK_SIZE = 1;//块大小单位M。开始是4M发现块越大行越多那么在一块中定位行的位置越慢
QVector<BlockIndex> blocks;//每一块的索引。打开文件的时候,需要建立该索引 QVector<BlockIndex> blocks;//每一块的索引。打开文件的时候,需要建立该索引
BigTextEditFileMgr():filePtr(nullptr), file(nullptr), m_curBlockIndex(0), loadWithCode(CODE_ID::UNKOWN), lineEndType(RC_LINE_FORM::UNKNOWN_LINE) BigTextEditFileMgr():filePtr(nullptr), file(nullptr), m_curBlockIndex(0), loadWithCode(CODE_ID::UNKOWN), lineEndType(RC_LINE_FORM::UNKNOWN_LINE)
{ {

View File

@ -1,4 +1,4 @@
#include "columnedit.h" #include "columnedit.h"
#include "scintillaeditview.h" #include "scintillaeditview.h"
ColumnEdit::ColumnEdit(QWidget *parent) ColumnEdit::ColumnEdit(QWidget *parent)
@ -54,7 +54,7 @@ void ColumnEdit::slot_bigChar(bool isCheck)
ui.capital->setEnabled(isCheck); ui.capital->setEnabled(isCheck);
} }
//自动调整当前窗口的状态 //自动调整当前窗口的状态
QWidget* ColumnEdit::autoAdjustCurrentEditWin() QWidget* ColumnEdit::autoAdjustCurrentEditWin()
{ {
QWidget* pw = m_editTabWidget->currentWidget(); QWidget* pw = m_editTabWidget->currentWidget();
@ -93,7 +93,7 @@ void ColumnEdit::slot_ok()
QString prefix = ui.prefix->text(); QString prefix = ui.prefix->text();
bool isCapital = ui.capital->isChecked(); bool isCapital = ui.capital->isChecked();
//是插入文本模式 //是插入文本模式
if (ui.textGroupBox->isChecked()) if (ui.textGroupBox->isChecked())
{ {
@ -138,7 +138,7 @@ void ColumnEdit::slot_ok()
} }
else else
{ {
//这里要加个提示 //这里要加个提示
QApplication::beep(); QApplication::beep();
return; return;
} }
@ -209,7 +209,7 @@ void ColumnEdit::slot_ok()
lineText.chrg.cpMin = static_cast<Sci_Position>(lineBegin); lineText.chrg.cpMin = static_cast<Sci_Position>(lineBegin);
lineText.chrg.cpMax = static_cast<Sci_Position>(lineEnd); lineText.chrg.cpMax = static_cast<Sci_Position>(lineEnd);
lineText.lpstrText = lineData.data(); lineText.lpstrText = lineData.data();
//获取原始行的内容 //获取原始行的内容
pEdit->SendScintilla(SCI_GETTEXTRANGE, 0, &lineText); pEdit->SendScintilla(SCI_GETTEXTRANGE, 0, &lineText);
if (lineEndCol < cursorCol) if (lineEndCol < cursorCol)

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QWidget> #include <QWidget>
#include <QTabWidget> #include <QTabWidget>

View File

@ -1,4 +1,4 @@
#include "common.h" #include "common.h"
int nbDigitsFromNbLines(size_t nbLines) int nbDigitsFromNbLines(size_t nbLines)

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QAction> #include <QAction>
#include <qscilexer.h> #include <qscilexer.h>

View File

@ -1,4 +1,4 @@
#include "ctipwin.h" #include "ctipwin.h"
#include <QTimer> #include <QTimer>

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QWidget> #include <QWidget>
#include "ui_ctipwin.h" #include "ui_ctipwin.h"

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QWidget> #include <QWidget>
#include <QMap> #include <QMap>

View File

@ -1,4 +1,4 @@
#include "draglineedit.h" #include "draglineedit.h"
DragLineEdit::DragLineEdit(QWidget *parent) DragLineEdit::DragLineEdit(QWidget *parent)
: QLineEdit(parent) : QLineEdit(parent)
@ -12,9 +12,9 @@ DragLineEdit::~DragLineEdit()
void DragLineEdit::dragEnterEvent(QDragEnterEvent* event) void DragLineEdit::dragEnterEvent(QDragEnterEvent* event)
{ {
if (event->mimeData()->hasFormat("text/uri-list")) //只能打开文本文件 if (event->mimeData()->hasFormat("text/uri-list")) //只能打开文本文件
{ {
event->accept(); //可以在这个窗口部件上拖放对象 event->accept(); //可以在这个窗口部件上拖放对象
} }
else else
{ {

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QLineEdit> #include <QLineEdit>
#include <QLineEdit> #include <QLineEdit>
@ -16,10 +16,10 @@ public:
protected: protected:
///< 拖动文件到窗口 触发 ///< 拖动文件到窗口 触发
void dragEnterEvent(QDragEnterEvent* event) override; void dragEnterEvent(QDragEnterEvent* event) override;
///< 拖动文件到窗口移动文件 触发 ///< 拖动文件到窗口移动文件 触发
void dragMoveEvent(QDragMoveEvent* event) override; void dragMoveEvent(QDragMoveEvent* event) override;
///< 拖动文件到窗口释放文件触发 ///< 拖动文件到窗口释放文件触发
void dropEvent(QDropEvent* event) override; void dropEvent(QDropEvent* event) override;
}; };

View File

@ -1,7 +1,7 @@
#include "extlexermanager.h" #include "extlexermanager.h"
//专门用来管理用户自定义的Ext 和 词法Lexer关联的类。 //专门用来管理用户自定义的Ext 和 词法Lexer关联的类。
//给出一个文件的ext后缀快速告知该使用什么lexer进行语法高亮 //给出一个文件的ext后缀快速告知该使用什么lexer进行语法高亮
ExtLexerManager* ExtLexerManager::s_instance = nullptr; ExtLexerManager* ExtLexerManager::s_instance = nullptr;
@ -42,9 +42,9 @@ void ExtLexerManager::remove(QString ext)
} }
//ext:文件的后缀名 langTagName:语言的tag名称 //ext:文件的后缀名 langTagName:语言的tag名称
//lexerId 语法的id如果是用户自定义则必然是L_USER_TXT,L_USER_CPP,L_USER_HTML,L_USER_JS,L_USER_XML, L_USER_INI 中的一个。 //lexerId 语法的id如果是用户自定义则必然是L_USER_TXT,L_USER_CPP,L_USER_HTML,L_USER_JS,L_USER_XML, L_USER_INI 中的一个。
//langTagName:只有在用户定义语言下才需要tagName。因为非用户定义的lexer其tagname是固定的。 //langTagName:只有在用户定义语言下才需要tagName。因为非用户定义的lexer其tagname是固定的。
void ExtLexerManager::addNewExtType(QString ext, LangType lexerId, QString langTagName) void ExtLexerManager::addNewExtType(QString ext, LangType lexerId, QString langTagName)
{ {
LexerInfo value(lexerId, langTagName); LexerInfo value(lexerId, langTagName);
@ -61,7 +61,7 @@ bool ExtLexerManager::getLexerTypeByExt(QString ext, LexerInfo& lexer)
return false; return false;
} }
//列出tag语言下面的所有关联的文件后缀列表 //列出tag语言下面的所有关联的文件后缀列表
void ExtLexerManager::getExtlistByLangTag(QString tag, QStringList& extList) void ExtLexerManager::getExtlistByLangTag(QString tag, QStringList& extList)
{ {
for (QMap<QString, LexerInfo>::iterator it = m_extToLexerIdMap.begin(); it != m_extToLexerIdMap.end(); ++it) for (QMap<QString, LexerInfo>::iterator it = m_extToLexerIdMap.begin(); it != m_extToLexerIdMap.end(); ++it)
@ -75,7 +75,7 @@ void ExtLexerManager::getExtlistByLangTag(QString tag, QStringList& extList)
} }
} }
//列出tag语言下面的所有关联的文件后缀列表 //列出tag语言下面的所有关联的文件后缀列表
void ExtLexerManager::getExtlistByLangTag(QMap<QString,QStringList>& extLangMap) void ExtLexerManager::getExtlistByLangTag(QMap<QString,QStringList>& extLangMap)
{ {
for (QMap<QString, LexerInfo>::iterator it = m_extToLexerIdMap.begin(); it != m_extToLexerIdMap.end(); ++it) for (QMap<QString, LexerInfo>::iterator it = m_extToLexerIdMap.begin(); it != m_extToLexerIdMap.end(); ++it)

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QMap> #include <QMap>
#include <qscilexer.h> #include <qscilexer.h>
@ -26,8 +26,8 @@ enum LangType {
#endif #endif
struct LexerInfo{ struct LexerInfo{
LangType lexerId; //如果是L_USER_DEFINE则表示母版的类型 LangType lexerId; //如果是L_USER_DEFINE则表示母版的类型
QString tagName; //语言tag名称。 QString tagName; //语言tag名称。
bool isUserDefineLangs() bool isUserDefineLangs()
{ {
return (lexerId > L_USER_DEFINE); return (lexerId > L_USER_DEFINE);
@ -55,10 +55,10 @@ public:
bool getLexerTypeByExt(QString ext, LexerInfo& lexer); bool getLexerTypeByExt(QString ext, LexerInfo& lexer);
//列出tag语言下面的所有关联的文件后缀列表 //列出tag语言下面的所有关联的文件后缀列表
void getExtlistByLangTag(QString tag, QStringList& extList); void getExtlistByLangTag(QString tag, QStringList& extList);
//列出所有语言下面的所有关联的文件后缀列表 //列出所有语言下面的所有关联的文件后缀列表
void getExtlistByLangTag(QMap<QString, QStringList>& extLangMap); void getExtlistByLangTag(QMap<QString, QStringList>& extLangMap);

View File

@ -1,4 +1,4 @@
#include "filecmprulewin.h" #include "filecmprulewin.h"
FileCmpRuleWin::FileCmpRuleWin(int mode, bool blankMath, int equalRato,QWidget *parent) FileCmpRuleWin::FileCmpRuleWin(int mode, bool blankMath, int equalRato,QWidget *parent)
: QWidget(parent) : QWidget(parent)

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QWidget> #include <QWidget>
#include "ui_filecmprulewin.h" #include "ui_filecmprulewin.h"

View File

@ -1,11 +1,11 @@
#include "filelistview.h" #include "filelistview.h"
#include "rcglobal.h" #include "rcglobal.h"
#include "ccnotepad.h" #include "ccnotepad.h"
#include <QListWidgetItem> #include <QListWidgetItem>
#include <QMenu> #include <QMenu>
//当显示文件多了以后,把所有文件列在该列表中 //当显示文件多了以后,把所有文件列在该列表中
FileListView::FileListView(QWidget *parent) FileListView::FileListView(QWidget *parent)
: QWidget(parent), m_pNotepad(nullptr) : QWidget(parent), m_pNotepad(nullptr)
@ -14,7 +14,7 @@ FileListView::FileListView(QWidget *parent)
connect(ui.filelistWidget, &QListWidget::itemDoubleClicked, this, &FileListView::itemDoubleClicked); connect(ui.filelistWidget, &QListWidget::itemDoubleClicked, this, &FileListView::itemDoubleClicked);
setContextMenuPolicy(Qt::CustomContextMenu); //设置枚举值 setContextMenuPolicy(Qt::CustomContextMenu); //设置枚举值
connect(this, &QListWidget::customContextMenuRequested, this, &FileListView::slot_ShowPopMenu); connect(this, &QListWidget::customContextMenuRequested, this, &FileListView::slot_ShowPopMenu);
} }
@ -29,7 +29,7 @@ void FileListView::setNotepadWin(QWidget* pNotepad)
m_pNotepad = pNotepad; m_pNotepad = pNotepad;
} }
//右键菜单 //右键菜单
void FileListView::slot_ShowPopMenu(const QPoint& pos) void FileListView::slot_ShowPopMenu(const QPoint& pos)
{ {
QListWidgetItem* curItem = ui.filelistWidget->itemAt(pos); QListWidgetItem* curItem = ui.filelistWidget->itemAt(pos);
@ -53,11 +53,11 @@ void FileListView::slot_ShowPopMenu(const QPoint& pos)
{ {
pNotePad->closeFileByEditWidget(m_fileEditMap.value(curItem->text()).pEditWidget); pNotePad->closeFileByEditWidget(m_fileEditMap.value(curItem->text()).pEditWidget);
} }
//注意这里不需要在删除m_fileEditMap元素因为closeFileByEditWidget里面会调用。 //注意这里不需要在删除m_fileEditMap元素因为closeFileByEditWidget里面会调用。
} }
}); });
//没有名称表示是对齐的item不存在对应的文件只是占位 //没有名称表示是对齐的item不存在对应的文件只是占位
if (curItem->text().isEmpty()) if (curItem->text().isEmpty())
{ {
actionAdd->setEnabled(false); actionAdd->setEnabled(false);

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QWidget> #include <QWidget>
#include <QListWidgetItem> #include <QListWidgetItem>

View File

@ -1,4 +1,4 @@
#include "findcmpwin.h" #include "findcmpwin.h"
#include "qscidisplaywindow.h" #include "qscidisplaywindow.h"
#include <QRadioButton> #include <QRadioButton>
#include <QMessageBox> #include <QMessageBox>

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QMainWindow> #include <QMainWindow>
#include <QTabWidget> #include <QTabWidget>

View File

@ -1,4 +1,4 @@
#include "findresultwin.h" #include "findresultwin.h"
#include "findwin.h" #include "findwin.h"
#include "common.h" #include "common.h"
#include "styleset.h" #include "styleset.h"

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QWidget> #include <QWidget>
#include <QContextMenuEvent> #include <QContextMenuEvent>

View File

@ -1,4 +1,4 @@
#include "findwin.h" #include "findwin.h"
#include "scintillaeditview.h" #include "scintillaeditview.h"
#include "ccnotepad.h" #include "ccnotepad.h"
#include "progresswin.h" #include "progresswin.h"

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QMainWindow> #include <QMainWindow>
#include <QTabWidget> #include <QTabWidget>

View File

@ -1,4 +1,4 @@
#include "gotolinewin.h" #include "gotolinewin.h"
GoToLineWin::GoToLineWin(QWidget *parent) GoToLineWin::GoToLineWin(QWidget *parent)
: QWidget(parent) : QWidget(parent)

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QWidget> #include <QWidget>
#include "ui_gotolinewin.h" #include "ui_gotolinewin.h"

View File

@ -1,4 +1,4 @@
#include "hexcmprangewin.h" #include "hexcmprangewin.h"
#include <QLineEdit> #include <QLineEdit>
#include <QMessageBox> #include <QMessageBox>
@ -23,7 +23,7 @@ void HexCmpRangeWin::slot_ok()
close(); close();
} }
//通过左边的值同步右边。右边不同步左边,加速用户输入 //通过左边的值同步右边。右边不同步左边,加速用户输入
void HexCmpRangeWin::slot_asyncStartPos(const QString& text) void HexCmpRangeWin::slot_asyncStartPos(const QString& text)
{ {
ui.rightStartPos->setText(text); ui.rightStartPos->setText(text);
@ -35,7 +35,7 @@ void HexCmpRangeWin::slot_asyncLenPos(const QString& text)
} }
//如果取消,则不返回任何有效范围值;错误值也是 //如果取消,则不返回任何有效范围值;错误值也是
const int MAX_CMP_LENS = 1024 * 1024 * 10; const int MAX_CMP_LENS = 1024 * 1024 * 10;
void HexCmpRangeWin::getRange(bool & isCancel, qint64 & leftStartPos, int & leftCmpLen, qint64 & rightStartPos, int & rightCmpLen) void HexCmpRangeWin::getRange(bool & isCancel, qint64 & leftStartPos, int & leftCmpLen, qint64 & rightStartPos, int & rightCmpLen)

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QDialog> #include <QDialog>
#include "ui_hexcmprangewin.h" #include "ui_hexcmprangewin.h"

View File

@ -1,4 +1,4 @@
#include "hexfilegoto.h" #include "hexfilegoto.h"
HexFileGoto::HexFileGoto(QWidget *parent) HexFileGoto::HexFileGoto(QWidget *parent)
: QWidget(parent) : QWidget(parent)
@ -13,7 +13,7 @@ HexFileGoto::~HexFileGoto()
{ {
} }
//显示为 //显示为
void HexFileGoto::slot_showDecInfo(const QString &text) void HexFileGoto::slot_showDecInfo(const QString &text)
{ {
bool ok; bool ok;

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QWidget> #include <QWidget>
#include "ui_hexfilegoto.h" #include "ui_hexfilegoto.h"

View File

@ -1,4 +1,4 @@
#include "hexrulewin.h" #include "hexrulewin.h"
HexRuleWin::HexRuleWin(int mode, int highlight, QWidget *parent): QWidget(parent), m_mode(mode), m_isHighlightBackgroud(highlight) HexRuleWin::HexRuleWin(int mode, int highlight, QWidget *parent): QWidget(parent), m_mode(mode), m_isHighlightBackgroud(highlight)
{ {

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QWidget> #include <QWidget>
#include "ui_hexrulewin.h" #include "ui_hexrulewin.h"

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QString> #include <QString>
#include <QMenu> #include <QMenu>
@ -16,13 +16,13 @@
struct ndd_proc_data struct ndd_proc_data
{ {
QString m_strPlugName; //插件名称 必选 QString m_strPlugName; //插件名称 必选
QString m_strFilePath; //lib 插件的全局路径。必选。插件内部不用管,主程序传递下来 QString m_strFilePath; //lib 插件的全局路径。必选。插件内部不用管,主程序传递下来
QString m_strComment; //插件说明 QString m_strComment; //插件说明
QString m_version; //版本号码。可选 QString m_version; //版本号码。可选
QString m_auther;//作者名称。可选 QString m_auther;//作者名称。可选
int m_menuType;//菜单类型。0不使用二级菜单 1创建二级菜单 int m_menuType;//菜单类型。0不使用二级菜单 1创建二级菜单
QMenu* m_rootMenu;//如果m_menuType = 1给出二级根菜单的地址。其他值nullptr QMenu* m_rootMenu;//如果m_menuType = 1给出二级根菜单的地址。其他值nullptr
ndd_proc_data(): m_rootMenu(nullptr), m_menuType(0) ndd_proc_data(): m_rootMenu(nullptr), m_menuType(0)
{ {

View File

@ -1,4 +1,4 @@
#include "langextset.h" #include "langextset.h"
#include "scintillaeditview.h" #include "scintillaeditview.h"
#include "extlexermanager.h" #include "extlexermanager.h"
#include "ccnotepad.h" #include "ccnotepad.h"
@ -9,8 +9,8 @@
#include <QMessageBox> #include <QMessageBox>
int ITEM_CHANGED = Qt::UserRole; int ITEM_CHANGED = Qt::UserRole;
int ITEM_LEX_ID = Qt::UserRole + 1; //对应的语法lexer的 ID int ITEM_LEX_ID = Qt::UserRole + 1; //对应的语法lexer的 ID
int ITEM_LEX_EXT_OLD_VALUE = Qt::UserRole + 2; //对应的语法关联EXT文件的旧值 int ITEM_LEX_EXT_OLD_VALUE = Qt::UserRole + 2; //对应的语法关联EXT文件的旧值
LangExtSet::LangExtSet(QWidget *parent) LangExtSet::LangExtSet(QWidget *parent)
: QMainWindow(parent), m_isChanged(false) : QMainWindow(parent), m_isChanged(false)
@ -62,7 +62,7 @@ void LangExtSet::initLangName()
QTableWidgetItem* item1 = new QTableWidgetItem(extList.join(',')); QTableWidgetItem* item1 = new QTableWidgetItem(extList.join(','));
item1->setData(ITEM_CHANGED, QVariant(false)); item1->setData(ITEM_CHANGED, QVariant(false));
//把旧值记起来,后面修改后对比实时修改内存中的改动 //把旧值记起来,后面修改后对比实时修改内存中的改动
item1->setData(ITEM_LEX_EXT_OLD_VALUE, QVariant(extList)); item1->setData(ITEM_LEX_EXT_OLD_VALUE, QVariant(extList));
ui.langTableWidget->setItem(langId, 1, item1); ui.langTableWidget->setItem(langId, 1, item1);
@ -141,12 +141,12 @@ void LangExtSet::slot_save()
QString langLexerTag = QString("%1_lexId").arg(langTag); QString langLexerTag = QString("%1_lexId").arg(langTag);
qs.setValue(langLexerTag, lexId); qs.setValue(langLexerTag, lexId);
//上面是更新文件,下面是更新内存,让实时生效 //上面是更新文件,下面是更新内存,让实时生效
QStringList oldExtList = item->data(ITEM_LEX_EXT_OLD_VALUE).toStringList(); QStringList oldExtList = item->data(ITEM_LEX_EXT_OLD_VALUE).toStringList();
updataExtLexerManager(langTag, lexId, oldExtList, extList); updataExtLexerManager(langTag, lexId, oldExtList, extList);
//更新新值。因为可能不关闭时再次修改 //更新新值。因为可能不关闭时再次修改
item->setData(ITEM_LEX_EXT_OLD_VALUE, QVariant(extList)); item->setData(ITEM_LEX_EXT_OLD_VALUE, QVariant(extList));
} }
} }
@ -156,15 +156,15 @@ void LangExtSet::slot_save()
ui.statusBar->showMessage(tr("Save Finished !"), 10000); ui.statusBar->showMessage(tr("Save Finished !"), 10000);
} }
//更新ExtLexerManager中tag关联的值 //更新ExtLexerManager中tag关联的值
void LangExtSet::updataExtLexerManager(QString tag, int lexId, QStringList & oldExtList, QStringList & newExtList) void LangExtSet::updataExtLexerManager(QString tag, int lexId, QStringList & oldExtList, QStringList & newExtList)
{ {
//把旧的直接删除 //把旧的直接删除
for (int i = 0; i < oldExtList.size(); ++i) for (int i = 0; i < oldExtList.size(); ++i)
{ {
ExtLexerManager::getInstance()->remove(oldExtList.at(i)); ExtLexerManager::getInstance()->remove(oldExtList.at(i));
} }
//把新的重新加入一遍 //把新的重新加入一遍
for (int i = 0; i < newExtList.size(); ++i) for (int i = 0; i < newExtList.size(); ++i)
{ {
FileExtLexer v; FileExtLexer v;
@ -175,10 +175,10 @@ void LangExtSet::updataExtLexerManager(QString tag, int lexId, QStringList & old
} }
} }
//加载文件的关联后缀到语法中 //加载文件的关联后缀到语法中
void LangExtSet::loadExtRelevanceToMagr() void LangExtSet::loadExtRelevanceToMagr()
{ {
QString userLangFile = QString("notepad/tag_ext");//自定义语言中不能有.字符,否则可能有错,后续要检查 QString userLangFile = QString("notepad/tag_ext");//自定义语言中不能有.字符,否则可能有错,后续要检查
QSettings qs(QSettings::IniFormat, QSettings::UserScope, userLangFile); QSettings qs(QSettings::IniFormat, QSettings::UserScope, userLangFile);
qs.setIniCodec("UTF-8"); qs.setIniCodec("UTF-8");

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QMainWindow> #include <QMainWindow>
#include "ui_langextset.h" #include "ui_langextset.h"

View File

@ -1,4 +1,4 @@
#include "langstyledefine.h" #include "langstyledefine.h"
#include "userlexdef.h" #include "userlexdef.h"
#include "extlexermanager.h" #include "extlexermanager.h"

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QMainWindow> #include <QMainWindow>
#include "ui_langstyledefine.h" #include "ui_langstyledefine.h"

View File

@ -1,4 +1,4 @@
#include "mytreeview.h" #include "mytreeview.h"
MyTreeView::MyTreeView(QWidget *parent) MyTreeView::MyTreeView(QWidget *parent)
: QTreeView(parent) : QTreeView(parent)

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QTreeView> #include <QTreeView>
#include <QModelIndexList> #include <QModelIndexList>

View File

@ -1,4 +1,4 @@
#include "nddsetting.h" #include "nddsetting.h"
#include <QObject> #include <QObject>
#include <QtDebug> #include <QtDebug>
#include <QCoreApplication> #include <QCoreApplication>
@ -7,8 +7,8 @@
#include <QStorageInfo> #include <QStorageInfo>
#include <QSettings> #include <QSettings>
static short version_num = 29; //1.22.0 是29 static short version_num = 29; //1.22.0 是29
//配置文件是否存在。如果初始化失败,则不存在 //配置文件是否存在。如果初始化失败,则不存在
bool NddSetting::s_isExistDb = false; bool NddSetting::s_isExistDb = false;
int NddSetting::s_reference = 0; int NddSetting::s_reference = 0;
bool NddSetting::s_isContentChanged = false; bool NddSetting::s_isContentChanged = false;
@ -17,10 +17,10 @@ QSettings* NddSetting::s_nddSet = nullptr;
QSettings* NddSetting::s_winPosSet = nullptr; QSettings* NddSetting::s_winPosSet = nullptr;
//如果key不存在则新增key-value。存在返回true //如果key不存在则新增key-value。存在返回true
bool NddSetting::checkNoExistAdd(QString key, QVariant& value) bool NddSetting::checkNoExistAdd(QString key, QVariant& value)
{ {
//每次新加字段后,这里要检查一下,不存在则新增 //每次新加字段后,这里要检查一下,不存在则新增
if (!s_nddSet->contains(key)) if (!s_nddSet->contains(key))
{ {
s_nddSet->setValue(key, value); s_nddSet->setValue(key, value);
@ -34,13 +34,13 @@ bool NddSetting::checkNoExistAdd(QString key, QVariant& value)
return true; return true;
} }
//20220402这里隐含了一个前置条件数据库句柄是在主线程创建的最好不要在子线程中调用。 //20220402这里隐含了一个前置条件数据库句柄是在主线程创建的最好不要在子线程中调用。
//避免因为跨线程访问和多线程冲突访问引发的闪退问题。所以最好配置文件的读写都在主线程中进行 //避免因为跨线程访问和多线程冲突访问引发的闪退问题。所以最好配置文件的读写都在主线程中进行
void NddSetting::init() void NddSetting::init()
{ {
++s_reference; ++s_reference;
//如果已经初始化过了,则直接返回 //如果已经初始化过了,则直接返回
if (s_isExistDb) if (s_isExistDb)
{ {
return; return;
@ -56,42 +56,42 @@ void NddSetting::init()
auto initNddSet = []() { auto initNddSet = []() {
QString key = "signdate"; QString key = "signdate";
//QString date = QDate::currentDate().toString(QString("yyyy/M/d")); //QString date = QDate::currentDate().toString(QString("yyyy/M/d"));
//不写今天的时间,否则第一次运行,无条件不会发送心跳。 //不写今天的时间,否则第一次运行,无条件不会发送心跳。
//直接写一个过去的时间,让第一次运行,总是要签到 //直接写一个过去的时间,让第一次运行,总是要签到
addKeyValueToSets(key, "2022/2/20"); addKeyValueToSets(key, "2022/2/20");
QString str; QString str;
//tab的长度默认为4 //tab的长度默认为4
addKeyValueToNumSets("tablens", 4); addKeyValueToNumSets("tablens", 4);
//space replace tab空格替换tab默认0, 1为true,0为false //space replace tab空格替换tab默认0, 1为true,0为false
addKeyValueToNumSets("tabnouse", 0); addKeyValueToNumSets("tabnouse", 0);
addKeyValueToSets("mac", "0"); addKeyValueToSets("mac", "0");
addKeyValueToNumSets("padtimes", 0); addKeyValueToNumSets("padtimes", 0);
addKeyValueToNumSets("serverip", 0); addKeyValueToNumSets("serverip", 0);
//是否高亮不同处背景 //是否高亮不同处背景
addKeyValueToNumSets("hexhigh", 1); addKeyValueToNumSets("hexhigh", 1);
addKeyValueToNumSets(VERSION, version_num); addKeyValueToNumSets(VERSION, version_num);
//皮肤id //皮肤id
addKeyValueToNumSets(SKIN_KEY, 0); addKeyValueToNumSets(SKIN_KEY, 0);
//语言index 0:自动选择 1:中文 2 英文 //语言index 0:自动选择 1:中文 2 英文
addKeyValueToNumSets(LANGS_KEY, 0); addKeyValueToNumSets(LANGS_KEY, 0);
//开启自动换行 //开启自动换行
addKeyValueToNumSets(AUTOWARP_KEY, 0); addKeyValueToNumSets(AUTOWARP_KEY, 0);
//开启自动缩进 //开启自动缩进
addKeyValueToNumSets(INDENT_KEY, 0); addKeyValueToNumSets(INDENT_KEY, 0);
//显示空白 //显示空白
addKeyValueToNumSets(SHOWSPACE_KEY, 0); addKeyValueToNumSets(SHOWSPACE_KEY, 0);
//最大文本文件的门限。默认100M.(50-300) //最大文本文件的门限。默认100M.(50-300)
addKeyValueToNumSets(MAX_BIG_TEXT, 100); addKeyValueToNumSets(MAX_BIG_TEXT, 100);
addKeyValueToSets(SOFT_KEY, "0"); addKeyValueToSets(SOFT_KEY, "0");
@ -107,22 +107,22 @@ void NddSetting::init()
addKeyValueToNumSets(FILELISTPOS, Qt::LeftDockWidgetArea); addKeyValueToNumSets(FILELISTPOS, Qt::LeftDockWidgetArea);
//默认0不显示 //默认0不显示
addKeyValueToNumSets(FILELISTSHOW, 0); addKeyValueToNumSets(FILELISTSHOW, 0);
//默认显示工具栏 //默认显示工具栏
addKeyValueToNumSets(TOOLBARSHOW, 1); addKeyValueToNumSets(TOOLBARSHOW, 1);
//打开网页,默认不勾选,资源耗费多 //打开网页,默认不勾选,资源耗费多
addKeyValueToNumSets(SHOWWEBADDR, 0); addKeyValueToNumSets(SHOWWEBADDR, 0);
//查找结果框的默认字体大小 //查找结果框的默认字体大小
addKeyValueToNumSets(FIND_RESULT_FONT_SIZE, 14); addKeyValueToNumSets(FIND_RESULT_FONT_SIZE, 14);
}; };
if (!s_nddSet->contains(VERSION)) if (!s_nddSet->contains(VERSION))
{ {
//不存在走初始化流程 //不存在走初始化流程
initNddSet(); initNddSet();
s_isContentChanged = true; s_isContentChanged = true;
} }
@ -133,7 +133,7 @@ void NddSetting::init()
QVariant v(VERSION); QVariant v(VERSION);
if (checkNoExistAdd(VERSION, v)) if (checkNoExistAdd(VERSION, v))
{ {
//如果存在,而且版本是最新,不需要走后面自动检查流程了 //如果存在,而且版本是最新,不需要走后面自动检查流程了
int curVersion = s_nddSet->value(VERSION).toInt(); int curVersion = s_nddSet->value(VERSION).toInt();
if (curVersion == version_num) if (curVersion == version_num)
{ {
@ -141,12 +141,12 @@ void NddSetting::init()
} }
else if (curVersion < version_num) else if (curVersion < version_num)
{ {
//更新版本到最新 //更新版本到最新
updataKeyValueFromNumSets(VERSION, version_num); updataKeyValueFromNumSets(VERSION, version_num);
} }
} }
} }
//每次新加字段后,这里要检查一下,不存在则新增 //每次新加字段后,这里要检查一下,不存在则新增
{ {
QVariant v(1); QVariant v(1);
checkNoExistAdd(SKIN_KEY, v); checkNoExistAdd(SKIN_KEY, v);
@ -237,7 +237,7 @@ void NddSetting::init()
//写一个总的获取配置的接口,避免以后每个字段都需要写一个读写接口 //写一个总的获取配置的接口,避免以后每个字段都需要写一个读写接口
QString NddSetting::getKeyValueFromSets(QString key) QString NddSetting::getKeyValueFromSets(QString key)
{ {
return s_nddSet->value(key,"").toString(); return s_nddSet->value(key,"").toString();
@ -250,7 +250,7 @@ bool NddSetting::updataKeyValueFromSets(QString key, QString value)
return true; return true;
} }
//写一个总的获取配置的接口,避免以后每个字段都需要写一个读写接口 //写一个总的获取配置的接口,避免以后每个字段都需要写一个读写接口
QByteArray NddSetting::getKeyByteArrayValue(QString key) QByteArray NddSetting::getKeyByteArrayValue(QString key)
{ {
return s_nddSet->value(key, "").toByteArray(); return s_nddSet->value(key, "").toByteArray();
@ -262,14 +262,14 @@ void NddSetting::updataKeyByteArrayValue(QString key, QByteArray& value)
s_isContentChanged = true; s_isContentChanged = true;
} }
//第一次加一条记录,用于初始化 //第一次加一条记录,用于初始化
void NddSetting::addKeyValueToSets(QString key, QString value) void NddSetting::addKeyValueToSets(QString key, QString value)
{ {
s_nddSet->setValue(key, QVariant(value)); s_nddSet->setValue(key, QVariant(value));
} }
//写一个总的获取配置的接口,避免以后每个字段都需要写一个读写接口.0做默认值外部最好不用0做初始化值 //写一个总的获取配置的接口,避免以后每个字段都需要写一个读写接口.0做默认值外部最好不用0做初始化值
int NddSetting::getKeyValueFromNumSets(const QString key) int NddSetting::getKeyValueFromNumSets(const QString key)
{ {
QVariant v = s_nddSet->value(key, QVariant(0)); QVariant v = s_nddSet->value(key, QVariant(0));
@ -283,7 +283,7 @@ bool NddSetting::updataKeyValueFromNumSets(const QString key, int value)
} }
//第一次加一条记录,用于初始化 //第一次加一条记录,用于初始化
void NddSetting::addKeyValueToNumSets(QString key, int value) void NddSetting::addKeyValueToNumSets(QString key, int value)
{ {
s_nddSet->setValue(key, QVariant(value)); s_nddSet->setValue(key, QVariant(value));
@ -300,7 +300,7 @@ void NddSetting::close()
{ {
s_isExistDb = false; s_isExistDb = false;
//做一次真正的保存 //做一次真正的保存
if (s_isContentChanged) if (s_isContentChanged)
{ {
s_nddSet->sync(); s_nddSet->sync();
@ -309,7 +309,7 @@ void NddSetting::close()
s_isContentChanged = false; s_isContentChanged = false;
} }
//在这里保存一下子窗口的位置。不排除有可能子窗口还在,主窗口已经退出的情况,不过问题不大。 //在这里保存一下子窗口的位置。不排除有可能子窗口还在,主窗口已经退出的情况,不过问题不大。
if (s_winPosSet != nullptr) if (s_winPosSet != nullptr)
{ {
s_winPosSet->sync(); s_winPosSet->sync();
@ -319,7 +319,7 @@ void NddSetting::close()
} }
} }
//子窗口的位置单独放在一个winpos.ini文件中而且启动程序时不需要读取可避免启动时拖慢速度 //子窗口的位置单独放在一个winpos.ini文件中而且启动程序时不需要读取可避免启动时拖慢速度
QByteArray NddSetting::getWinPos(QString key) QByteArray NddSetting::getWinPos(QString key)
{ {
winPosInit(); winPosInit();

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QSettings> #include <QSettings>
#include <QVariant> #include <QVariant>
@ -10,24 +10,24 @@ static QString SHOWSPACE_KEY = "blank";
static QString MAX_BIG_TEXT = "maxtsize"; static QString MAX_BIG_TEXT = "maxtsize";
static QString SOFT_STATUS = "rstatus"; static QString SOFT_STATUS = "rstatus";
static QString SOFT_KEY = "rkey"; static QString SOFT_KEY = "rkey";
static QString RESTORE_CLOSE_FILE = "restore"; //恢复关闭时打开的文件 static QString RESTORE_CLOSE_FILE = "restore"; //恢复关闭时打开的文件
static QString PRO_DIR = "prodir";//放置配置文件的路径 static QString PRO_DIR = "prodir";//放置配置文件的路径
//static QString RESTORE_SIZE = "rsize";//保存关闭时的大小 //static QString RESTORE_SIZE = "rsize";//保存关闭时的大小
static QString WIN_POS = "pos";//保存关闭是的大小 static QString WIN_POS = "pos";//保存关闭是的大小
static QString ICON_SIZE = "iconsize";//图标大小 static QString ICON_SIZE = "iconsize";//图标大小
static QString ZOOMVALUE = "zoom"; //放大倍数 static QString ZOOMVALUE = "zoom"; //放大倍数
static QString VERSION = "version";//当前版本 static QString VERSION = "version";//当前版本
static QString FINDRESULTPOS = "findpos";//查找窗口悬浮的位置 static QString FINDRESULTPOS = "findpos";//查找窗口悬浮的位置
static QString FILELISTPOS = "filepos";//文件列表悬浮框的位置 static QString FILELISTPOS = "filepos";//文件列表悬浮框的位置
static QString FILELISTSHOW = "showfilelist"; //文件列表框是否显示 static QString FILELISTSHOW = "showfilelist"; //文件列表框是否显示
static QString TOOLBARSHOW = "showbar"; //是否显示工具栏 static QString TOOLBARSHOW = "showbar"; //是否显示工具栏
static QString FINDWINSIZE = "findwinsize";//保存查找框的大小。150%放大时界面永久。保留避免每次手动调整 static QString FINDWINSIZE = "findwinsize";//保存查找框的大小。150%放大时界面永久。保留避免每次手动调整
static QString SHOWWEBADDR = "showweb";//高亮web地址双击网页打开 static QString SHOWWEBADDR = "showweb";//高亮web地址双击网页打开
static QString FIND_RESULT_FONT_SIZE = "frfs";//查找结果的默认字体大小默认为14 static QString FIND_RESULT_FONT_SIZE = "frfs";//查找结果的默认字体大小默认为14
//下面这个是winpos.ini中的key避免单个文件太大拖慢启动速度 //下面这个是winpos.ini中的key避免单个文件太大拖慢启动速度
static QString BATCH_FIND_REPLACE_POS = "bfpos";//批量查找替换窗口的大小 static QString BATCH_FIND_REPLACE_POS = "bfpos";//批量查找替换窗口的大小
class NddSetting class NddSetting
{ {

View File

@ -1,4 +1,4 @@
#include "ndstyleditemdelegate.h" #include "ndstyleditemdelegate.h"
#include <QTextDocument> #include <QTextDocument>
#include <QApplication> #include <QApplication>
#include <QAbstractTextDocumentLayout> #include <QAbstractTextDocumentLayout>
@ -21,7 +21,7 @@ void NdStyledItemDelegate::setFontSize(int size)
} }
//重载使可以支持富文本格式的文字 //重载使可以支持富文本格式的文字
void NdStyledItemDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const void NdStyledItemDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const
{ {
QStyleOptionViewItem viewOption(option); QStyleOptionViewItem viewOption(option);
@ -29,13 +29,13 @@ void NdStyledItemDelegate::paint(QPainter * painter, const QStyleOptionViewItem
if (option.state.testFlag(QStyle::State_HasFocus)) if (option.state.testFlag(QStyle::State_HasFocus))
viewOption.state = viewOption.state ^ QStyle::State_HasFocus; viewOption.state = viewOption.state ^ QStyle::State_HasFocus;
// ... 省略 // ... 省略
// 设置显示文本为空,使用默认样式 // 设置显示文本为空,使用默认样式
QStyle *pStyle = viewOption.widget ? viewOption.widget->style() : QApplication::style(); QStyle *pStyle = viewOption.widget ? viewOption.widget->style() : QApplication::style();
QTextDocument doc; QTextDocument doc;
//外部修改了字体大小后,内部进行富文本的修改绘制。 //外部修改了字体大小后,内部进行富文本的修改绘制。
if (m_defaultFontSize != 14) if (m_defaultFontSize != 14)
{ {
viewOption.text.replace("font-size:14px",QString("font-size:%1px").arg(m_defaultFontSize)); viewOption.text.replace("font-size:14px",QString("font-size:%1px").arg(m_defaultFontSize));
@ -51,9 +51,9 @@ void NdStyledItemDelegate::paint(QPainter * painter, const QStyleOptionViewItem
QRect textRect = pStyle->subElementRect(QStyle::SE_ItemViewItemText, &viewOption); QRect textRect = pStyle->subElementRect(QStyle::SE_ItemViewItemText, &viewOption);
painter->save(); painter->save();
// 坐标变换,将左上角设置为原点 // 坐标变换,将左上角设置为原点
painter->translate(textRect.topLeft()); painter->translate(textRect.topLeft());
// 设置HTML绘制区域 // 设置HTML绘制区域
painter->setClipRect(textRect.translated(-textRect.topLeft())); painter->setClipRect(textRect.translated(-textRect.topLeft()));
doc.documentLayout()->draw(painter, paintContext); doc.documentLayout()->draw(painter, paintContext);

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QStyledItemDelegate> #include <QStyledItemDelegate>

View File

@ -1,4 +1,4 @@
#include "plugin.h" #include "plugin.h"
#include <QLibrary> #include <QLibrary>
#include <QDir> #include <QDir>
#include <QMenu> #include <QMenu>

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include "pluginGl.h" #include "pluginGl.h"
#include <functional> #include <functional>
class QMenu; class QMenu;

View File

@ -1,182 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{06EED29A-D357-39F4-B1B8-25129EBC2852}</ProjectGuid>
<RootNamespace>helloworld</RootNamespace>
<Keyword>QtVS_v304</Keyword>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.19041.0</WindowsTargetPlatformMinVersion>
<QtMsBuild Condition="'$(QtMsBuild)'=='' or !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild></PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<PlatformToolset>v141</PlatformToolset>
<OutputDirectory>..\..\x64\Debug\plugin\</OutputDirectory>
<ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage>
<CharacterSet>NotSet</CharacterSet>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<IntermediateDirectory>release\</IntermediateDirectory>
<PrimaryOutput>helloworld</PrimaryOutput>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<PlatformToolset>v141</PlatformToolset>
<OutputDirectory>..\..\x64\Debug\plugin\</OutputDirectory>
<ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage>
<CharacterSet>NotSet</CharacterSet>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<IntermediateDirectory>debug\</IntermediateDirectory>
<PrimaryOutput>helloworld</PrimaryOutput>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /><Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')"><Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." /></Target>
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" /><ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')"><Import Project="$(QtMsBuild)\qt_defaults.props" /></ImportGroup><PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"><OutDir>..\..\x64\Debug\plugin\</OutDir><IntDir>debug\</IntDir><TargetName>helloworld</TargetName><IgnoreImportLibrary>true</IgnoreImportLibrary></PropertyGroup><PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"><OutDir>..\..\x64\Debug\plugin\</OutDir><IntDir>release\</IntDir><TargetName>helloworld</TargetName><IgnoreImportLibrary>true</IgnoreImportLibrary><LinkIncremental>false</LinkIncremental></PropertyGroup><PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"><QtInstall>5.12.10_msvc2017_64</QtInstall><QtModules>core;gui;widgets</QtModules></PropertyGroup><PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"><QtInstall>5.12.10_msvc2017_64</QtInstall><QtModules>core;gui;widgets</QtModules></PropertyGroup><ImportGroup Condition="Exists('$(QtMsBuild)\qt.props')"><Import Project="$(QtMsBuild)\qt.props" /></ImportGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>GeneratedFiles\$(ConfigurationName);GeneratedFiles;.;..\..\include;..\..\qscint\src;..\..\qscint\src\Qsci;release;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
<AssemblerListingLocation>release\</AssemblerListingLocation>
<BrowseInformation>false</BrowseInformation>
<DebugInformationFormat>None</DebugInformationFormat>
<DisableSpecificWarnings>4577;4467;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ExceptionHandling>Sync</ExceptionHandling>
<ObjectFileName>release\</ObjectFileName>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;QT_NO_DEBUG;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessToFile>false</PreprocessToFile>
<ProgramDataBaseFileName></ProgramDataBaseFileName>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<WarningLevel>Level3</WarningLevel>
<MultiProcessorCompilation>true</MultiProcessorCompilation></ClCompile>
<Link>
<AdditionalDependencies>qmyedit_qt5d.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<DataExecutionPrevention>true</DataExecutionPrevention>
<GenerateDebugInformation>false</GenerateDebugInformation>
<IgnoreImportLibrary>true</IgnoreImportLibrary>
<LinkDLL>true</LinkDLL>
<LinkIncremental>false</LinkIncremental>
<OutputFile>$(OutDir)\helloworld.dll</OutputFile>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<SubSystem>Windows</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
</Link>
<Midl>
<DefaultCharType>Unsigned</DefaultCharType>
<EnableErrorChecks>None</EnableErrorChecks>
<WarningLevel>0</WarningLevel>
</Midl>
<ResourceCompile>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;QT_NO_DEBUG;QT_WIDGETS_LIB;QT_GUI_LIB;QT_CORE_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<QtMoc><CompilerFlavor>msvc</CompilerFlavor><Include>./$(Configuration)/moc_predefs.h</Include><ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription><DynamicSource>output</DynamicSource><QtMocDir>$(Configuration)</QtMocDir><QtMocFileName>moc_%(Filename).cpp</QtMocFileName></QtMoc><QtUic><ExecutionDescription>Uic'ing %(Identity)...</ExecutionDescription><QtUicDir>$(ProjectDir)</QtUicDir><QtUicFileName>ui_%(Filename).h</QtUicFileName></QtUic></ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<AdditionalIncludeDirectories>GeneratedFiles\$(ConfigurationName);GeneratedFiles;.;..\..\include;..\..\qscint\src;..\..\qscint\src\Qsci;debug;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
<AssemblerListingLocation>debug\</AssemblerListingLocation>
<BrowseInformation>false</BrowseInformation>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4577;4467;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ExceptionHandling>Sync</ExceptionHandling>
<ObjectFileName>debug\</ObjectFileName>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessToFile>false</PreprocessToFile>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<WarningLevel>Level3</WarningLevel>
<MultiProcessorCompilation>true</MultiProcessorCompilation></ClCompile>
<Link>
<AdditionalDependencies>qmyedit_qt5d.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<DataExecutionPrevention>true</DataExecutionPrevention>
<GenerateDebugInformation>true</GenerateDebugInformation>
<IgnoreImportLibrary>true</IgnoreImportLibrary>
<LinkDLL>true</LinkDLL>
<OutputFile>$(OutDir)\helloworld.dll</OutputFile>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<SubSystem>Windows</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
</Link>
<Midl>
<DefaultCharType>Unsigned</DefaultCharType>
<EnableErrorChecks>None</EnableErrorChecks>
<WarningLevel>0</WarningLevel>
</Midl>
<ResourceCompile>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;QT_WIDGETS_LIB;QT_GUI_LIB;QT_CORE_LIB;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<QtMoc><CompilerFlavor>msvc</CompilerFlavor><Include>./$(Configuration)/moc_predefs.h</Include><ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription><DynamicSource>output</DynamicSource><QtMocDir>$(Configuration)</QtMocDir><QtMocFileName>moc_%(Filename).cpp</QtMocFileName></QtMoc><QtUic><ExecutionDescription>Uic'ing %(Identity)...</ExecutionDescription><QtUicDir>$(ProjectDir)</QtUicDir><QtUicFileName>ui_%(Filename).h</QtUicFileName></QtUic></ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="helloworldexport.cpp" />
<ClCompile Include="qttestclass.cpp" />
</ItemGroup>
<ItemGroup>
<QtMoc Include="qttestclass.h">
</QtMoc>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="debug\moc_predefs.h.cbt">
<FileType>Document</FileType>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(QTDIR)\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">cl -Bx"$(QTDIR)\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E $(QTDIR)\mkspecs\features\data\dummy.cpp 2&gt;NUL &gt;debug\moc_predefs.h</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generate moc_predefs.h</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">debug\moc_predefs.h;%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="release\moc_predefs.h.cbt">
<FileType>Document</FileType>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(QTDIR)\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">cl -Bx"$(QTDIR)\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E $(QTDIR)\mkspecs\features\data\dummy.cpp 2&gt;NUL &gt;release\moc_predefs.h</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Generate moc_predefs.h</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">release\moc_predefs.h;%(Outputs)</Outputs>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<QtUic Include="qttestclass.ui">
</QtUic>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /><ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')"><Import Project="$(QtMsBuild)\qt.targets" /></ImportGroup>
<ImportGroup Label="ExtensionTargets" />
</Project>

View File

@ -1,69 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Form Files">
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
<Extensions>ui</Extensions>
<ParseFiles>false</ParseFiles>
</Filter>
<Filter Include="Form Files">
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
<Extensions>ui</Extensions>
<ParseFiles>false</ParseFiles>
</Filter>
<Filter Include="Generated Files">
<UniqueIdentifier>{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}</UniqueIdentifier>
<Extensions>cpp;c;cxx;moc;h;def;odl;idl;res;</Extensions>
</Filter>
<Filter Include="Generated Files">
<UniqueIdentifier>{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}</UniqueIdentifier>
<Extensions>cpp;c;cxx;moc;h;def;odl;idl;res;</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="helloworldexport.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="qttestclass.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<QtMoc Include="qttestclass.h">
<Filter>Header Files</Filter>
</QtMoc>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="debug\moc_predefs.h.cbt">
<Filter>Generated Files</Filter>
</CustomBuild>
<CustomBuild Include="release\moc_predefs.h.cbt">
<Filter>Generated Files</Filter>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<QtUic Include="qttestclass.ui">
<Filter>Form Files</Filter>
</QtUic>
</ItemGroup>
</Project>

View File

@ -1,4 +1,4 @@
#include <qobject.h> #include <qobject.h>
#include <qstring.h> #include <qstring.h>
#include <pluginGl.h> #include <pluginGl.h>
#include <functional> #include <functional>

View File

@ -1,4 +1,4 @@
#include "qttestclass.h" #include "qttestclass.h"
#include <qsciscintilla.h> #include <qsciscintilla.h>
QtTestClass::QtTestClass(QWidget *parent, QsciScintilla* pEdit) QtTestClass::QtTestClass(QWidget *parent, QsciScintilla* pEdit)

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QWidget> #include <QWidget>
#include "ui_qttestclass.h" #include "ui_qttestclass.h"

View File

@ -1,4 +1,4 @@
#include <qobject.h> #include <qobject.h>
#include <qstring.h> #include <qstring.h>
#include <pluginGl.h> #include <pluginGl.h>
#include <functional> #include <functional>

View File

@ -1,16 +1,16 @@
#pragma once #pragma once
#include <QString> #include <QString>
#include <QMenu> #include <QMenu>
struct ndd_proc_data struct ndd_proc_data
{ {
QString m_strPlugName; //插件名称 必选。插件里面需填写 QString m_strPlugName; //插件名称 必选。插件里面需填写
QString m_strFilePath; //lib 插件的全局路径。必选。插件内部不用填写,主程序传递下来 QString m_strFilePath; //lib 插件的全局路径。必选。插件内部不用填写,主程序传递下来
QString m_strComment; //插件说明;插件里面需填写 QString m_strComment; //插件说明;插件里面需填写
QString m_version; //版本号码。可选;插件里面需填写 QString m_version; //版本号码。可选;插件里面需填写
QString m_auther;//作者名称。可选;插件里面需填写 QString m_auther;//作者名称。可选;插件里面需填写
int m_menuType;//菜单类型。0不使用二级菜单 1创建二级菜单插件里面需填写 int m_menuType;//菜单类型。0不使用二级菜单 1创建二级菜单插件里面需填写
QMenu* m_rootMenu;//如果m_menuType = 1给出二级根菜单的地址。其他值nullptr 插件内部不用填写,主程序传递下来 QMenu* m_rootMenu;//如果m_menuType = 1给出二级根菜单的地址。其他值nullptr 插件内部不用填写,主程序传递下来
ndd_proc_data(): m_rootMenu(nullptr), m_menuType(0) ndd_proc_data(): m_rootMenu(nullptr), m_menuType(0)
{ {

View File

@ -1,4 +1,4 @@
#include "pluginmgr.h" #include "pluginmgr.h"
#include "rcglobal.h" #include "rcglobal.h"

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QMainWindow> #include <QMainWindow>
#include "ui_pluginmgr.h" #include "ui_pluginmgr.h"

View File

@ -1,4 +1,4 @@
#include <QCoreApplication> #include <QCoreApplication>
#include <QFile> #include <QFile>
#include <QTextStream> #include <QTextStream>

View File

@ -1,4 +1,4 @@
/* Scintilla source code edit control */ /* Scintilla source code edit control */
/** @file Scintilla.h /** @file Scintilla.h
** Interface to the edit control. ** Interface to the edit control.
**/ **/

View File

@ -1,4 +1,4 @@
// Scintilla source code edit control // Scintilla source code edit control
/** @file LexAVS.cxx /** @file LexAVS.cxx
** Lexer for AviSynth. ** Lexer for AviSynth.
**/ **/

View File

@ -1,4 +1,4 @@
// Scintilla source code edit control // Scintilla source code edit control
/** @file Catalogue.cxx /** @file Catalogue.cxx
** Lexer infrastructure. ** Lexer infrastructure.
** Contains a list of LexerModules which can be searched to find a module appropriate for a ** Contains a list of LexerModules which can be searched to find a module appropriate for a

View File

@ -37,6 +37,7 @@
// Define QSCINTILLA_MAKE_DLL to create a QScintilla shared library, or // Define QSCINTILLA_MAKE_DLL to create a QScintilla shared library, or
// define QSCINTILLA_DLL to link against a QScintilla shared library, or define // define QSCINTILLA_DLL to link against a QScintilla shared library, or define
// neither to either build or link against a static QScintilla library. // neither to either build or link against a static QScintilla library.
#define QSCINTILLA_DLL
#if defined(QSCINTILLA_DLL) #if defined(QSCINTILLA_DLL)
#define QSCINTILLA_EXPORT Q_DECL_IMPORT #define QSCINTILLA_EXPORT Q_DECL_IMPORT

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
// This defines the interface to the QsciLexerAsm class. // This defines the interface to the QsciLexerAsm class.
// //
// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com> // Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QObject> #include <QObject>
#include <Qsci/qsciglobal.h> #include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h> #include <Qsci/qscilexer.h>

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#pragma once #pragma once
// This defines the interface to the QsciLexerR class. // This defines the interface to the QsciLexerR class.
// //

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#pragma once #pragma once
#include <QObject> #include <QObject>

View File

@ -1,4 +1,4 @@
// This module implements the QsciLexerAsm class. // This module implements the QsciLexerAsm class.
// //
// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com> // Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
// //

View File

@ -1,4 +1,4 @@
#include "Qsci/qscilexerglobal.h" #include "Qsci/qscilexerglobal.h"
#include "Qsci/qsciscintilla.h" #include "Qsci/qsciscintilla.h"
#include "Scintilla.h" #include "Scintilla.h"
#include "SciLexer.h" #include "SciLexer.h"

View File

@ -1,4 +1,4 @@

#include "Qsci/qsciLexerr.h" #include "Qsci/qsciLexerr.h"
#include <qcolor.h> #include <qcolor.h>

View File

@ -1,4 +1,4 @@
#include "Qsci/qscilexervb.h" #include "Qsci/qscilexervb.h"
QsciLexerVB::QsciLexerVB(QObject *parent) QsciLexerVB::QsciLexerVB(QObject *parent)
: QsciLexer(parent) : QsciLexer(parent)

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QMainWindow> #include <QMainWindow>
#include <QListWidgetItem> #include <QListWidgetItem>

View File

@ -15,7 +15,7 @@ static const char* VersionStr = "v1.22.2";
#endif // TEST_PRE #endif // TEST_PRE
//#define NO_PLUGIN 1 #define NO_PLUGIN 1
#define CMP_CODE_NOEQUAL #define CMP_CODE_NOEQUAL

View File

@ -1,4 +1,4 @@
#include "renamewin.h" #include "renamewin.h"
#include "progresswin.h" #include "progresswin.h"
#include <QFileDialog> #include <QFileDialog>

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QWidget> #include <QWidget>
#include "ui_renamewin.h" #include "ui_renamewin.h"

View File

@ -1,4 +1,4 @@
// This file is part of Notepad-- project // This file is part of Notepad-- project
// Copyright (C)2023 zuowei.yin <cxasm@qq.com> // Copyright (C)2023 zuowei.yin <cxasm@qq.com>
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify

View File

@ -1,4 +1,4 @@
#include "scintillaeditview.h" #include "scintillaeditview.h"
#include "common.h" #include "common.h"
#include "rgba_icons.h" #include "rgba_icons.h"

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <qsciscintilla.h> #include <qsciscintilla.h>
#include <Scintilla.h> #include <Scintilla.h>
#include <SciLexer.h> #include <SciLexer.h>

View File

@ -1,4 +1,4 @@
#include "scintillahexeditview.h" #include "scintillahexeditview.h"
#include "styleset.h" #include "styleset.h"
#include "ccnotepad.h" #include "ccnotepad.h"

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <qsciscintilla.h> #include <qsciscintilla.h>
#include <Scintilla.h> #include <Scintilla.h>

View File

@ -1,4 +1,4 @@
#include "shortcutkeyeditwin.h" #include "shortcutkeyeditwin.h"
#include <QMessageBox> #include <QMessageBox>
@ -27,7 +27,7 @@ QKeySequence ShortcutKeyEditWin::getNewKeySeq()
return m_newKeys; return m_newKeys;
} }
//确认修改,先检查一下。最多四个键 //确认修改,先检查一下。最多四个键
void ShortcutKeyEditWin::slot_ok() void ShortcutKeyEditWin::slot_ok()
{ {
QKeySequence keys = ui.keySequenceEdit->keySequence(); QKeySequence keys = ui.keySequenceEdit->keySequence();
@ -41,7 +41,7 @@ void ShortcutKeyEditWin::slot_ok()
done(1); done(1);
} }
//删除为空 //删除为空
void ShortcutKeyEditWin::on_delete() void ShortcutKeyEditWin::on_delete()
{ {
done(2); done(2);

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QDialog> #include <QDialog>
#include "ui_shortcutkeyeditwin.h" #include "ui_shortcutkeyeditwin.h"

View File

@ -1,4 +1,4 @@
#include "shortcutkeymgr.h" #include "shortcutkeymgr.h"
#include "shortcutkeyeditwin.h" #include "shortcutkeyeditwin.h"
#include "ccnotepad.h" #include "ccnotepad.h"
@ -13,12 +13,12 @@ QMap<QString, int>* ShortcutKeyMgr::s_shortcutKeysMap = nullptr;
//QMap<QString, int> * qScintShortcutKeyValueMap = nullptr; //QMap<QString, int> * qScintShortcutKeyValueMap = nullptr;
struct ShortcutKeySt { struct ShortcutKeySt {
QString iniTag;//保存在Ini文件中的名称 QString iniTag;//保存在Ini文件中的名称
QString name;//显示在表格中的名称 QString name;//显示在表格中的名称
//QString keyDesc;//qkeysequence的描述 //QString keyDesc;//qkeysequence的描述
QKeySequence key; QKeySequence key;
bool canModify;//能否修改 bool canModify;//能否修改
ShortcutKeySt() = default; ShortcutKeySt() = default;
ShortcutKeySt(QString name_, QString iniTag_, bool canMofidy=true) :name(name_), iniTag(iniTag_), canModify(canMofidy) ShortcutKeySt(QString name_, QString iniTag_, bool canMofidy=true) :name(name_), iniTag(iniTag_), canModify(canMofidy)
@ -119,12 +119,12 @@ void ShortcutKeyMgr::initShortcutKeysMap()
s_shortcutKeysMap->insert(shortCutTable.at(i).iniTag, i); s_shortcutKeysMap->insert(shortCutTable.at(i).iniTag, i);
} }
//从文件中读取用户修改过的配置表。 //从文件中读取用户修改过的配置表。
loadUserDefSet(); loadUserDefSet();
} }
} }
//务必先调用initShortcutKeysMap() //务必先调用initShortcutKeysMap()
QKeySequence ShortcutKeyMgr::getUserDefShortcutKey(QString iniTag) QKeySequence ShortcutKeyMgr::getUserDefShortcutKey(QString iniTag)
{ {
if (s_shortcutKeysMap->contains(iniTag)) if (s_shortcutKeysMap->contains(iniTag))
@ -134,7 +134,7 @@ QKeySequence ShortcutKeyMgr::getUserDefShortcutKey(QString iniTag)
return QKeySequence(); return QKeySequence();
} }
//从用户ini配置中加载快捷键配置 //从用户ini配置中加载快捷键配置
void ShortcutKeyMgr::loadUserDefSet() void ShortcutKeyMgr::loadUserDefSet()
{ {
QString userDefFile = QString("notepad/shortcuttab"); QString userDefFile = QString("notepad/shortcuttab");
@ -159,7 +159,7 @@ void ShortcutKeyMgr::loadUserDefSet()
} }
} }
//修改配置文件中的快捷键定义。inittag ini的key, keySeqStr ini的value。内存也修改了 //修改配置文件中的快捷键定义。inittag ini的key, keySeqStr ini的value。内存也修改了
bool ShortcutKeyMgr::ModifyShortCutKey(QString initTag, QString keySeqStr) bool ShortcutKeyMgr::ModifyShortCutKey(QString initTag, QString keySeqStr)
{ {
QString userDefFile = QString("notepad/shortcuttab"); QString userDefFile = QString("notepad/shortcuttab");
@ -210,7 +210,7 @@ void ShortcutKeyMgr::initNddShortcutTable()
} }
} }
//初始化qscint内部的快捷键。目前这部分不能修改。 //初始化qscint内部的快捷键。目前这部分不能修改。
void ShortcutKeyMgr::initQscintShortcutTable() void ShortcutKeyMgr::initQscintShortcutTable()
{ {
QsciScintilla* pNote = new QsciScintilla(nullptr); QsciScintilla* pNote = new QsciScintilla(nullptr);
@ -273,7 +273,7 @@ int ShortcutKeyMgr::isKeySeqExist(int row, QString keySeq, int &type)
} }
return -1; return -1;
} }
//双击修改槽函数 //双击修改槽函数
void ShortcutKeyMgr::slot_edit(QTableWidgetItem* item) void ShortcutKeyMgr::slot_edit(QTableWidgetItem* item)
{ {
int row = item->row(); int row = item->row();
@ -289,14 +289,14 @@ void ShortcutKeyMgr::slot_edit(QTableWidgetItem* item)
pWin->setCurKeyDesc(shortCutTable.at(row).key.toString()); pWin->setCurKeyDesc(shortCutTable.at(row).key.toString());
int ret = pWin->exec(); int ret = pWin->exec();
if (1 == ret) //确定 if (1 == ret) //确定
{ {
QKeySequence newKeySeq = pWin->getNewKeySeq(); QKeySequence newKeySeq = pWin->getNewKeySeq();
QTableWidgetItem* item = ui.tableWidget->item(row, 1); QTableWidgetItem* item = ui.tableWidget->item(row, 1);
if (item != nullptr) if (item != nullptr)
{ {
//检查是否冲突,如果冲突,则不设置。先预留 //检查是否冲突,如果冲突,则不设置。先预留
int conflictType = 0; int conflictType = 0;
int existId = isKeySeqExist(row, newKeySeq.toString(), conflictType); int existId = isKeySeqExist(row, newKeySeq.toString(), conflictType);
if (-1 == existId) if (-1 == existId)
@ -329,7 +329,7 @@ void ShortcutKeyMgr::slot_edit(QTableWidgetItem* item)
} }
} }
} }
else if (2 == ret)//删除 else if (2 == ret)//删除
{ {
QKeySequence newKeySeq(QKeySequence::UnknownKey); QKeySequence newKeySeq(QKeySequence::UnknownKey);

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QMainWindow> #include <QMainWindow>
#include "ui_shortcutkeymgr.h" #include "ui_shortcutkeymgr.h"
@ -38,7 +38,7 @@ enum Shortcut_Key_ID {
Format_Json_ID, Format_Json_ID,
Shortcut_End_ID,//总是在最底下 Shortcut_End_ID,//总是在最底下
}; };
static const char* New_File = "newfile"; static const char* New_File = "newfile";

View File

@ -1,4 +1,4 @@
#include "styleset.h" #include "styleset.h"
#include "ccnotepad.h" #include "ccnotepad.h"
#include <QFile> #include <QFile>
#include <QPalette> #include <QPalette>
@ -70,7 +70,7 @@ void StyleSet::setCommonStyle(QColor foldfgColor_, QColor foldbgColor_, QColor m
foldbgColor = foldbgColor_; foldbgColor = foldbgColor_;
marginsBackgroundColor = marginsBackgroundColor_; marginsBackgroundColor = marginsBackgroundColor_;
QFile file(":/qss/lightbluestyle.qss"); //qss文件路径:/lightblue.qss QFile file(":/qss/lightbluestyle.qss"); //qss文件路径:/lightblue.qss
QString styleSheet; QString styleSheet;
if (file.open(QIODevice::Text | QIODevice::ReadOnly)) if (file.open(QIODevice::Text | QIODevice::ReadOnly))
{ {
@ -128,7 +128,7 @@ void StyleSet::setSkin(int id)
} }
} }
//重新加载Global全局风格 //重新加载Global全局风格
void StyleSet::reloadGolbalStyleFromSetFile() void StyleSet::reloadGolbalStyleFromSetFile()
{ {
loadGolbalStyle(); loadGolbalStyle();
@ -140,7 +140,7 @@ void StyleSet::loadGolbalStyle()
QsciLexerGlobal* pGlobalLexer = dynamic_cast<QsciLexerGlobal*>(pLexer); QsciLexerGlobal* pGlobalLexer = dynamic_cast<QsciLexerGlobal*>(pLexer);
if (pGlobalLexer != nullptr) if (pGlobalLexer != nullptr)
{ {
//获取其属性颜色然后填入。后续在ScintillaEditView中直接设置这些One_Stype_Info的属性值 //获取其属性颜色然后填入。后续在ScintillaEditView中直接设置这些One_Stype_Info的属性值
One_Stype_Info* pAddr = &s_global_style->global_style; One_Stype_Info* pAddr = &s_global_style->global_style;
for (int i = 0; i <= URL_HOVERRED; ++i) for (int i = 0; i <= URL_HOVERRED; ++i)
@ -158,7 +158,7 @@ QString StyleSet::getCurrentStyle()
return getStyleName(m_curStyleId); return getStyleName(m_curStyleId);
} }
//是否深色风格系列 //是否深色风格系列
bool StyleSet::isCurrentDeepStyle() bool StyleSet::isCurrentDeepStyle()
{ {
switch (m_curStyleId) switch (m_curStyleId)
@ -217,7 +217,7 @@ void StyleSet::setDefaultStyle()
marginsBackgroundColor = QColor(0xf0f0f0); marginsBackgroundColor = QColor(0xf0f0f0);
bookmarkBkColor = QColor(0xececec); bookmarkBkColor = QColor(0xececec);
QFile file(":/qss/mystyle.qss"); //qss文件路径:/lightblue.qss QFile file(":/qss/mystyle.qss"); //qss文件路径:/lightblue.qss
QString styleSheet; QString styleSheet;
if (file.open(QIODevice::Text | QIODevice::ReadOnly)) if (file.open(QIODevice::Text | QIODevice::ReadOnly))
{ {
@ -246,7 +246,7 @@ void StyleSet::setThinBlueStyle()
setCommonStyle(QColor(0xd7, 0xe3, 0xf4, 100), QColor(0xd7e3f4), QColor(0xd5e1f1), "#D7E3F4"); setCommonStyle(QColor(0xd7, 0xe3, 0xf4, 100), QColor(0xd7e3f4), QColor(0xd5e1f1), "#D7E3F4");
} }
//纸黄 //纸黄
void StyleSet::setThinYellowStyle() void StyleSet::setThinYellowStyle()
{ {
//m_curStyleId = THIN_YELLOW_SE; //m_curStyleId = THIN_YELLOW_SE;
@ -254,7 +254,7 @@ void StyleSet::setThinYellowStyle()
setCommonStyle(QColor(0xf9, 0xf0, 0xe1, 100), QColor(0xf9f0e1), QColor(0xf7f0e0), "#F9F0E1"); setCommonStyle(QColor(0xf9, 0xf0, 0xe1, 100), QColor(0xf9f0e1), QColor(0xf7f0e0), "#F9F0E1");
} }
//宣纸黄 //宣纸黄
void StyleSet::setRiceYellowStyle() void StyleSet::setRiceYellowStyle()
{ {
//m_curStyleId = RICE_YELLOW_SE; //m_curStyleId = RICE_YELLOW_SE;
@ -262,7 +262,7 @@ void StyleSet::setRiceYellowStyle()
setCommonStyle(QColor(0xf6, 0xf3, 0xea, 100), QColor(0xf6f3ea), QColor(0xf4f1e9), "#F6F3EA"); setCommonStyle(QColor(0xf6, 0xf3, 0xea, 100), QColor(0xf6f3ea), QColor(0xf4f1e9), "#F6F3EA");
} }
//银色 //银色
void StyleSet::setSilverStyle() void StyleSet::setSilverStyle()
{ {
//m_curStyleId = SILVER_SE; //m_curStyleId = SILVER_SE;
@ -270,7 +270,7 @@ void StyleSet::setSilverStyle()
setCommonStyle(QColor(0xe9, 0xe8, 0xe4, 100), QColor(0xe9e8e4), QColor(0xe7e6e2), "#E9E8E4"); setCommonStyle(QColor(0xe9, 0xe8, 0xe4, 100), QColor(0xe9e8e4), QColor(0xe7e6e2), "#E9E8E4");
} }
//谈紫色#FFF0F5 //谈紫色#FFF0F5
void StyleSet::setLavenderBlushStyle() void StyleSet::setLavenderBlushStyle()
{ {
//m_curStyleId = LAVENDER_SE; //m_curStyleId = LAVENDER_SE;
@ -293,14 +293,14 @@ void StyleSet::setBlackStyle()
foldfgColor = QColor(0,0, 0); foldfgColor = QColor(0,0, 0);
foldbgColor = QColor(32, 32, 40); foldbgColor = QColor(32, 32, 40);
//注意暗黑模式是单独的窗口背景颜色。上面的foldbgColor决定了编辑器的背景颜色。 //注意暗黑模式是单独的窗口背景颜色。上面的foldbgColor决定了编辑器的背景颜色。
//暗黑模式窗体背景不完全是黑色而是686868 //暗黑模式窗体背景不完全是黑色而是686868
QColor blackPaletteColor(68,68,68); QColor blackPaletteColor(68,68,68);
marginsBackgroundColor = QColor(57, 58, 60); marginsBackgroundColor = QColor(57, 58, 60);
bookmarkBkColor = QColor(53,54,56); bookmarkBkColor = QColor(53,54,56);
QFile file(":/qss/black.qss"); //qss文件路径:/lightblue.qss QFile file(":/qss/black.qss"); //qss文件路径:/lightblue.qss
QString styleSheet; QString styleSheet;
if (file.open(QIODevice::Text | QIODevice::ReadOnly)) if (file.open(QIODevice::Text | QIODevice::ReadOnly))
{ {
@ -325,7 +325,7 @@ void StyleSet::setBlackStyle()
marginsBackgroundColor = QColor(57, 58, 60); marginsBackgroundColor = QColor(57, 58, 60);
bookmarkBkColor = QColor(53, 54, 56); bookmarkBkColor = QColor(53, 54, 56);
QFile file(":/qss/myblack.qss"); //qss文件路径:/lightblue.qss QFile file(":/qss/myblack.qss"); //qss文件路径:/lightblue.qss
QString styleSheet; QString styleSheet;
if (file.open(QIODevice::Text | QIODevice::ReadOnly)) if (file.open(QIODevice::Text | QIODevice::ReadOnly))
{ {

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QColor> #include <QColor>
#include <QFont> #include <QFont>
@ -30,7 +30,7 @@ struct One_Stype_Info {
int styleId; int styleId;
QColor fgColor; QColor fgColor;
QColor bgColor; QColor bgColor;
QFont font; //这个font代表两个含有1是字体而是字体大小。有些属性比如括号大小他们没有字体但是有大小则使用字体大小来表示 QFont font; //这个font代表两个含有1是字体而是字体大小。有些属性比如括号大小他们没有字体但是有大小则使用字体大小来表示
One_Stype_Info() :styleId(-1) One_Stype_Info() :styleId(-1)
{ {
} }
@ -40,7 +40,7 @@ struct One_Stype_Info {
}; };
//当前的全局风格属性,所有的样式修改,都是先修改这个结构体,然后其余地方再根据这个修改后的结构体,来进行同步更新 //当前的全局风格属性,所有的样式修改,都是先修改这个结构体,然后其余地方再根据这个修改后的结构体,来进行同步更新
struct GLOBAL_STYLE_OPS { struct GLOBAL_STYLE_OPS {
One_Stype_Info global_style; One_Stype_Info global_style;
One_Stype_Info default_style; One_Stype_Info default_style;

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QWidget> #include <QWidget>
#include "ui_texteditsetwin.h" #include "ui_texteditsetwin.h"

View File

@ -1,4 +1,4 @@
#include "userlexdef.h" #include "userlexdef.h"
#include "rcglobal.h" #include "rcglobal.h"
#include <QSettings> #include <QSettings>
@ -12,14 +12,14 @@ UserLexDef::~UserLexDef()
} }
//自己定义一套读取和保存配置的接口 //自己定义一套读取和保存配置的接口
bool UserLexDef::readUserSettings(QString langTagName) bool UserLexDef::readUserSettings(QString langTagName)
{ {
//自定义语言格式。 //自定义语言格式。
//mz:ndd //mz:ndd
//name:xxx //name:xxx
//mother:xxx none/cpp/html 就三种 //mother:xxx none/cpp/html 就三种
//keword:xxx //keword:xxx
QString userLangFile = QString("notepad/userlang/%1").arg(langTagName); QString userLangFile = QString("notepad/userlang/%1").arg(langTagName);
@ -28,7 +28,7 @@ bool UserLexDef::readUserSettings(QString langTagName)
if (!qs.contains(QString("mz"))) if (!qs.contains(QString("mz")))
{ {
//必须包含Mz为Ndd的键否则错误 //必须包含Mz为Ndd的键否则错误
return false; return false;
} }
if (qs.value("mz").toString() != QString("ndd")) if (qs.value("mz").toString() != QString("ndd"))
@ -84,11 +84,11 @@ void UserLexDef::setMotherLang(UserLangMother words)
bool UserLexDef::writeUserSettings(QString langTagName) bool UserLexDef::writeUserSettings(QString langTagName)
{ {
//自定义语言格式。 //自定义语言格式。
//mz:ndd //mz:ndd
//name:xxx //name:xxx
//mother:xxx none/cpp/html 就三种 //mother:xxx none/cpp/html 就三种
//ext:xx xx xx 文件关联后缀名 //ext:xx xx xx 文件关联后缀名
//keyword:xxx //keyword:xxx
QString userLangFile = QString("notepad/userlang/%1").arg(langTagName); QString userLangFile = QString("notepad/userlang/%1").arg(langTagName);

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <QObject> #include <QObject>
#include "rcglobal.h" #include "rcglobal.h"