From 6d8d8b9ab9c651c765b4026c6d845202017e9ea3 Mon Sep 17 00:00:00 2001 From: asc Date: Fri, 3 Mar 2023 23:48:22 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BA=8C=E8=BF=9B=E5=88=B6=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E9=80=89=E6=8B=A9=E4=BA=8C=E8=BF=9B=E5=88=B6=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=92=8C=E6=96=87=E6=9C=AC=E9=83=A8=E5=88=86=E5=90=8C?= =?UTF-8?q?=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scintillahexeditview.cpp | 128 +++++++++++++++++++++++++++++++++++ src/scintillahexeditview.h | 14 ++++ 2 files changed, 142 insertions(+) diff --git a/src/scintillahexeditview.cpp b/src/scintillahexeditview.cpp index c8da9b2..18f0ea1 100755 --- a/src/scintillahexeditview.cpp +++ b/src/scintillahexeditview.cpp @@ -122,6 +122,134 @@ void ScintillaHexEditView::dropEvent(QDropEvent* e) //qDebug() << ui.leftSrc->geometry() << ui.rightSrc->geometry() << QCursor::pos() << this->mapFromGlobal(QCursor::pos()); } +void ScintillaHexEditView::mouseMoveEvent(QMouseEvent* e) +{ + if (property("type").toInt() == HEX_TYPE && selecting) + { + long from, to; + int r1, c1, r2, c2; + int begin, end; + const int col_hex_start = 9; + const int col_hex_finish = 56; + const int col_text_start = 57; + const int col_text_finish = 72; + const int col_num = 75; + + m_SelTo = Scintilla::Point::FromInts(e->x(), e->y()); + + from = execute(SCI_POSITIONFROMPOINT, m_SelFrom.x, m_SelFrom.y); + to = execute(SCI_POSITIONFROMPOINT, m_SelTo.x, m_SelTo.y); + + lineIndexFromPosition(from, &r1, &c1); + lineIndexFromPosition(to, &r2, &c2); + + execute(SCI_CLEARSELECTIONS); + + if (r1 < 0 || c1 < 0 || r2 < 0 || c2 < 0) + return; + + + if (c1 < col_text_start || c1 > col_text_finish) + { + //选择二进制区域 + for (int i = r1; i <= r2; ++i) + { + //每行hex显示区域 + if (i == r1) + { + if (c1 < col_hex_start) + begin = col_hex_start; + else if (c1 > col_hex_finish) + begin = col_hex_finish; + else begin = c1 / 3 * 3; + } + else + begin = col_hex_start; + + if (i == r2) + { + if (c2 < col_hex_start) + end = col_hex_start; + else if (c2 > col_hex_finish) + end = col_hex_finish; + else end = c2 / 3 * 3 + 2; + } + else + end = col_hex_finish; + + + for (int j = begin; j < end; j += 3) + { + execute(SCI_ADDSELECTION, i * col_num + j, i * col_num + j + 2); + execute(SCI_ADDSELECTION, i * col_num + col_text_start + (j - col_hex_start) / 3, + i * col_num + col_text_start + (j - col_hex_start) / 3 + 1); + } + } + } + else + { + //选择字符区域 + for (int i = r1; i <= r2; ++i) + { + //每行字符显示区域 + if (i == r1) + { + if (c1 < col_text_start) + begin = col_text_start; + else if (c1 > col_text_finish) + begin = col_text_finish; + else begin = c1; + } + else + begin = col_text_start; + + if (i == r2) + { + if (c2 < col_text_start) + end = col_text_start; + else if (c2 > col_text_finish) + end = col_text_finish; + else end = c2; + } + else + end = col_text_finish; + + + for (int j = begin; j <= end; ++j) + { + execute(SCI_ADDSELECTION, i * col_num + col_hex_start + (j - col_text_start) * 3, + i * col_num + col_hex_start + (j - col_text_start) * 3 + 2); + execute(SCI_ADDSELECTION, i * col_num + j, i * col_num + j + 1); + } + } + } + return; + } + QsciScintillaBase::mouseMoveEvent(e); +} + +void ScintillaHexEditView::mousePressEvent(QMouseEvent* e) +{ + if (property("type").toInt() == HEX_TYPE && !selecting) + { + execute(SCI_CLEARSELECTIONS); + selecting = true; + m_SelFrom = Scintilla::Point::FromInts(e->x(), e->y()); + return; + } + QsciScintillaBase::mousePressEvent(e); +} + +void ScintillaHexEditView::mouseReleaseEvent(QMouseEvent* e) +{ + if (property("type").toInt() == HEX_TYPE && selecting) + { + selecting = false; + return; + } + QsciScintillaBase::mouseReleaseEvent(e); +} + void ScintillaHexEditView::updateThemes() { diff --git a/src/scintillahexeditview.h b/src/scintillahexeditview.h index 26b6c3f..5154416 100755 --- a/src/scintillahexeditview.h +++ b/src/scintillahexeditview.h @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -33,6 +34,14 @@ protected: void dragEnterEvent(QDragEnterEvent * event); void dropEvent(QDropEvent * e); + //! Re-implemented to handle mouse moves. + virtual void mouseMoveEvent(QMouseEvent* e); + + //! Re-implemented to handle mouse presses. + virtual void mousePressEvent(QMouseEvent* e); + + //! Re-implemented to handle mouse releases. + virtual void mouseReleaseEvent(QMouseEvent* e); private: static bool _SciInit; @@ -41,4 +50,9 @@ private: SCINTILLA_PTR m_pScintillaPtr = 0; CCNotePad* m_NoteWin; + + bool selecting = false; + + Scintilla::Point m_SelFrom; + Scintilla::Point m_SelTo; }; -- Gitee From 404d48b887b0fe507f2b8d5ef6f9b5850edde1eb Mon Sep 17 00:00:00 2001 From: cleverxiao Date: Fri, 10 Mar 2023 17:40:11 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=BE=8E=E5=8C=96=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/batchfindreplace.cpp | 1 + src/batchfindreplace.ui | 8 - src/columnedit.ui | 303 +++++-------- src/encodeconvert.cpp | 2 + src/encodeconvert.ui | 365 ++++++++-------- src/findwin.ui | 864 +++++++++++++++++--------------------- src/langextset.cpp | 3 +- src/langextset.ui | 67 ++- src/langstyledefine.ui | 124 ++---- src/md5hash.ui | 13 + src/pluginmgr.ui | 18 - src/qtlangset.ui | 52 ++- src/shortcutkeyeditwin.ui | 15 +- src/shortcutkeymgr.cpp | 15 +- src/shortcutkeymgr.ui | 16 +- 15 files changed, 848 insertions(+), 1018 deletions(-) diff --git a/src/batchfindreplace.cpp b/src/batchfindreplace.cpp index e305b9f..80ab82e 100755 --- a/src/batchfindreplace.cpp +++ b/src/batchfindreplace.cpp @@ -14,6 +14,7 @@ BatchFindReplace::BatchFindReplace(QWidget *parent) ui.setupUi(this); m_mainNotepad = dynamic_cast(parent); + ui.findReplaceTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); } BatchFindReplace::~BatchFindReplace() diff --git a/src/batchfindreplace.ui b/src/batchfindreplace.ui index e644c09..d8a286b 100755 --- a/src/batchfindreplace.ui +++ b/src/batchfindreplace.ui @@ -164,14 +164,6 @@ - - - TopToolBarArea - - - false - - diff --git a/src/columnedit.ui b/src/columnedit.ui index 94f0329..b887992 100755 --- a/src/columnedit.ui +++ b/src/columnedit.ui @@ -6,16 +6,10 @@ 0 0 - 337 - 316 + 393 + 325 - - - 350 - 330 - - ColumnEdit @@ -23,59 +17,25 @@ :/Resources/edit/global/ndd.ico:/Resources/edit/global/ndd.ico - - - 3 - - - 3 - - - 3 - - - 3 - + - - - - - Insert Text - - - true - - - - - - 1024 - - - - - - - - - - - - Ok - - - - - - - Close - - - - - - + + + Insert Text + + + true + + + + + + 1024 + + + + + @@ -89,22 +49,16 @@ false - - 9 - - - - 20 - - + + Initial value: - + 1 @@ -117,34 +71,14 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - 20 - - + increment: - + @@ -157,34 +91,14 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - 20 - - + Repetitions: - + @@ -197,53 +111,20 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - 20 - - + prefix string: - + false - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -251,32 +132,19 @@ Format - - - - - - - Decimal - - - true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - + + + + + Decimal + + + true + + + + + @@ -299,23 +167,19 @@ - - - - - - Octal - - - - - - - Binary - - - - + + + + Octal + + + + + + + Binary + + @@ -323,6 +187,63 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Ok + + + + + + + Close + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + diff --git a/src/encodeconvert.cpp b/src/encodeconvert.cpp index c17022e..d08fd67 100755 --- a/src/encodeconvert.cpp +++ b/src/encodeconvert.cpp @@ -144,6 +144,8 @@ void EncodeConvert::slot_selectFile() if (!rootpath.isEmpty()) { + ui.lineEdit->setText(rootpath); + ui.treeWidget->clear(); m_fileAttris.clear(); diff --git a/src/encodeconvert.ui b/src/encodeconvert.ui index 6d09681..7c0e853 100755 --- a/src/encodeconvert.ui +++ b/src/encodeconvert.ui @@ -6,8 +6,8 @@ 0 0 - 969 - 614 + 943 + 586 @@ -17,207 +17,220 @@ :/Resources/img/main.png:/Resources/img/main.png - - - 2 - + - 2 + 3 - 2 + 3 2 - 2 + 3 - - - - filePath - - - - - file size + + + + + true + + + + + + + select dir + + + + + + + + + + + + filePath + + + + + file size + + + + + file code + + + + + convert code + + + + + convert result + + + + + + + + + + + + + convert options + + + + 3 - - - - file code + + 3 - - - - convert code + + 2 - - - - convert result + + 2 - - - - - - - - - 20 - - - - - convert options - - + + + + + + convert to code + + + + + + + + 200 + 0 + + - - - - - convert to code - - - - - - - - 200 - 0 - - - - - UTF8 - - - - - UTF8 BOM - - - - - UTF16-LE - - - - - UTF16-BE - - - - - GBK - - - - - + + UTF8 + - - - - - deal file ext - - - - - - - - 150 - 0 - - - - - all support file ext - - - - - - - - user defined - - - defined - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - select dir + UTF8 BOM - - - - + + - start + UTF16-LE - - false - - - - - + + - close + UTF16-BE - - - - - - Qt::Horizontal + + + + GBK - - - 40 - 20 - + + + + + + + + + + + deal file ext + + + + + + + + 150 + 0 + + + + + all support file ext - - - - - + + + + + + + user defined + + + defined + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + - + + + start + + + false + + + + + + + close + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + diff --git a/src/findwin.ui b/src/findwin.ui index cb65339..fa8ea45 100755 --- a/src/findwin.ui +++ b/src/findwin.ui @@ -6,8 +6,8 @@ 0 0 - 689 - 384 + 701 + 350 @@ -18,18 +18,24 @@ :/Resources/edit/global/ndd.ico:/Resources/edit/global/ndd.ico + + + 700 + 328 + + - 3 + 0 - 3 + 0 - 2 + 0 - 2 + 0 @@ -46,14 +52,26 @@ find - + + + 3 + + + 3 + + + 2 + 2 - + + + 0 + @@ -65,22 +83,13 @@ Find what : + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + - - - 300 - 0 - - - - - 350 - 16777215 - - true @@ -92,7 +101,7 @@ - + Qt::Vertical @@ -105,106 +114,84 @@ - + + + 9 + + + 0 + + + 0 + + + 0 + - - - - - Backward direction - - - - - - - Match whole word only - - - - - - - Match case - - - - - - - Wrap around - - - true - - - - + + + Backward direction + + - - - Qt::Vertical + + + Match whole word only - - - 20 - 20 - + + + + + + Match case - + - - - Search Mode + + + Wrap around + + + true - - - - - - - Regular expression - - - - - - - - - Normal - - - true - - - - - - - Extend(\n,\r,\t,\0,\x...) - - - - - - - Qt::Vertical - - - - 20 - 40 - + + + Search Mode - + + + + + Normal + + + true + + + + + + + Extend(\n,\r,\t,\0,\x...) + + + + + + + Regular expression + + + + + @@ -340,16 +327,28 @@ Replace - + + + 3 + + + 3 + + + 2 + 2 - + - + + + 0 + @@ -361,22 +360,13 @@ Find what : + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + - - - 300 - 0 - - - - - 350 - 16777215 - - true @@ -388,7 +378,10 @@ - + + + 0 + @@ -400,6 +393,9 @@ Replace with : + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + @@ -410,18 +406,6 @@ 0 - - - 300 - 0 - - - - - 350 - 16777215 - - @@ -429,14 +413,14 @@ - + Qt::Vertical 20 - 40 + 20 @@ -445,6 +429,18 @@ + + 9 + + + 0 + + + 0 + + + 0 + @@ -478,26 +474,13 @@ - - - - Qt::Vertical - - - - 20 - 20 - - - - Search Mode - - + + Normal @@ -507,40 +490,23 @@ - - - - - - Regular expression - - - - - - + Extend(\n,\r,\t,\0,\x...) + + + + Regular expression + + + - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -664,64 +630,163 @@ Dir Find - + + + 3 + + + 3 + + + 2 + 2 - + - - - - - - 0 - 0 - - - - Dest Dir : + + + + + 0 - + + + + + 0 + 0 + + + + Dest Dir : + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Select + + + + - - - - - 0 - 0 - - - - - 250 - 0 - - - - - 350 - 16777215 - + + + + 0 - + + + + + 0 + 0 + + + + Find what : + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + 512 + + + + - - - - - 0 - 20 - - - - Select + + + + 0 - + + + + + 0 + 0 + + + + Replace with : + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + - - + + + + + + Qt::Vertical + + + + 20 + 20 + + + + + + + + 9 + + + 0 + + + 5 + + + 0 @@ -729,184 +794,69 @@ - Find what : - - - - - - - - 250 - 0 - - - - - 350 - 16777215 - - - - true - - - 512 + Skip Dir Name : - - - - - - + + false - + 0 0 - - - 300 - 0 - - - - - 350 - 16777215 - - - *.c:*.cpp:*.h - - - - - - - - 0 - 0 - - - - File Type : + debug:Debug:.vs:.git:.svn - - - - - 0 - 0 - - + + - Replace with : + Match whole word only - - - - - - - 0 - 0 - + + true - - Skip Dir Name : + + false - - + + false - + 0 0 - - - 300 - 0 - - - - - 350 - 16777215 - - - debug:Debug:.vs:.git:.svn + *.c:*.cpp:*.h - - + + - + 0 0 - - - 300 - 0 - - - - - 350 - 16777215 - - - - - - - - - - Qt::Vertical - - - - 20 - 20 - - - - - - - - - Match whole word only - - - true - - - false + File Type : - + Match case @@ -916,60 +866,46 @@ - - - Qt::Vertical - - - - 20 - 20 - - - - - - + - - - - - Search Mode - - - - - - Normal - - - true - - - - - - - - - Regular expression - - - - - - - - - Extend(\n,\r,\t,\0,\x...) - - - - - - - + + + Search Mode + + + + + + Normal + + + true + + + + + + + Extend(\n,\r,\t,\0,\x...) + + + + + + + Regular expression + + + + + + + + + + + + @@ -1150,14 +1086,26 @@ Mark - + + + 3 + + + 3 + + + 2 + 2 - + - + + + 0 + @@ -1169,22 +1117,13 @@ Mark What + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + - - - 300 - 0 - - - - - 350 - 16777215 - - true @@ -1196,7 +1135,7 @@ - + Qt::Vertical @@ -1210,6 +1149,18 @@ + + 9 + + + 0 + + + 0 + + + 0 + @@ -1226,37 +1177,13 @@ - - - - Qt::Vertical - - - - 20 - 20 - - - - Search Mode - - - - - - - Regular expression - - - - - - + + Normal @@ -1266,29 +1193,23 @@ - + Extend(\n,\r,\t,\0,\x...) + + + + Regular expression + + + - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -1425,16 +1346,11 @@ replaceModeRegularBt destFindDir dirFindWhat - dirReplaceWhat selectDir dirFindAll dirReplaceAll clearBt dirClose - dealFileType - fileType - skipDir - skipDirNames dirFindMatchWholeBox dirFindMatchCaseBox dirFindModeNormalBox diff --git a/src/langextset.cpp b/src/langextset.cpp index a1db834..2ac872e 100755 --- a/src/langextset.cpp +++ b/src/langextset.cpp @@ -18,6 +18,7 @@ LangExtSet::LangExtSet(QWidget *parent) ui.setupUi(this); ui.langTableWidget->horizontalHeader()->setSectionResizeMode(1, QHeaderView::ResizeToContents); + ui.langTableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); initLangName(); connect(ui.langTableWidget, &QTableWidget::itemChanged, this, &LangExtSet::slot_itemChanged); @@ -225,4 +226,4 @@ void LangExtSet::closeEvent(QCloseEvent* e) slot_save(); } } -} \ No newline at end of file +} diff --git a/src/langextset.ui b/src/langextset.ui index 981a33d..e84a4d6 100755 --- a/src/langextset.ui +++ b/src/langextset.ui @@ -6,7 +6,7 @@ 0 0 - 809 + 415 504 @@ -14,42 +14,45 @@ LangExtSet - - + + 3 - + 3 - 3 + 2 - 3 + 2 - - - - Language - - - - - File Suffix - - - - - - - - - 16777215 - 100 - - - + + + + + QAbstractItemView::SingleSelection + + + false + + + + Language + + + + + File Suffix + + + + + + + + @@ -97,14 +100,6 @@ - - - TopToolBarArea - - - false - - diff --git a/src/langstyledefine.ui b/src/langstyledefine.ui index 0738f81..45dc68f 100755 --- a/src/langstyledefine.ui +++ b/src/langstyledefine.ui @@ -38,7 +38,7 @@ Setting - + 3 @@ -46,41 +46,41 @@ 3 - 3 + 2 - 3 - - - 3 + 2 - - 6 - - - - + + + Definition Language - + - - - - - - + + + + 256 + + + js cs (split with space) + + + + + - Mother Language + Expand File Name: - + @@ -94,32 +94,52 @@ + + + + Mother Language + + + - + + + + Qt::Vertical + + + + 17 + 382 + + + + + - + Delete - + New Create - + Save - + Close @@ -128,40 +148,6 @@ - - - - - - Expand File Name: - - - - - - - 256 - - - js cs (split with space) - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -197,24 +183,6 @@ - - - - 0 - 0 - 843 - 23 - - - - - - TopToolBarArea - - - false - - diff --git a/src/md5hash.ui b/src/md5hash.ui index a004d64..d34c048 100755 --- a/src/md5hash.ui +++ b/src/md5hash.ui @@ -140,6 +140,19 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + diff --git a/src/pluginmgr.ui b/src/pluginmgr.ui index 27dd173..fe611e0 100755 --- a/src/pluginmgr.ui +++ b/src/pluginmgr.ui @@ -99,24 +99,6 @@ - - - - 0 - 0 - 974 - 23 - - - - - - TopToolBarArea - - - false - - diff --git a/src/qtlangset.ui b/src/qtlangset.ui index 855d4fe..19ae047 100755 --- a/src/qtlangset.ui +++ b/src/qtlangset.ui @@ -19,6 +19,18 @@ + + 3 + + + 3 + + + 2 + + + 2 + @@ -264,6 +276,18 @@ Color + + 3 + + + 3 + + + 2 + + + 2 + @@ -480,9 +504,15 @@ 0 + + 3 + 0 + + 2 + @@ -491,7 +521,7 @@ - + @@ -519,7 +549,7 @@ - + @@ -632,24 +662,6 @@ - - - - 0 - 0 - 1029 - 23 - - - - - - TopToolBarArea - - - false - - diff --git a/src/shortcutkeyeditwin.ui b/src/shortcutkeyeditwin.ui index 996e9e6..6657908 100755 --- a/src/shortcutkeyeditwin.ui +++ b/src/shortcutkeyeditwin.ui @@ -7,7 +7,7 @@ 0 0 459 - 137 + 125 @@ -42,6 +42,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + diff --git a/src/shortcutkeymgr.cpp b/src/shortcutkeymgr.cpp index 88e3969..c40d65a 100755 --- a/src/shortcutkeymgr.cpp +++ b/src/shortcutkeymgr.cpp @@ -43,12 +43,15 @@ ShortcutKeyMgr::ShortcutKeyMgr(QWidget *parent) connect(ui.tableWidget, &QTableWidget::itemDoubleClicked, this, &ShortcutKeyMgr::slot_edit); - ui.tableWidget->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents); - ui.tableWidget->horizontalHeader()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - ui.tableWidget->horizontalHeader()->setSectionResizeMode(2, QHeaderView::ResizeToContents); - ui.qscintTableWidget->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents); - ui.qscintTableWidget->horizontalHeader()->setSectionResizeMode(1, QHeaderView::ResizeToContents); - ui.qscintTableWidget->horizontalHeader()->setSectionResizeMode(2, QHeaderView::ResizeToContents); +// ui.tableWidget->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents); +// ui.tableWidget->horizontalHeader()->setSectionResizeMode(1, QHeaderView::ResizeToContents); +// ui.tableWidget->horizontalHeader()->setSectionResizeMode(2, QHeaderView::ResizeToContents); +// ui.qscintTableWidget->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents); +// ui.qscintTableWidget->horizontalHeader()->setSectionResizeMode(1, QHeaderView::ResizeToContents); +// ui.qscintTableWidget->horizontalHeader()->setSectionResizeMode(2, QHeaderView::ResizeToContents); + + ui.tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); + ui.qscintTableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); QString tabQss = "QHeaderView::section{" diff --git a/src/shortcutkeymgr.ui b/src/shortcutkeymgr.ui index cf6ba84..1ffb3b8 100755 --- a/src/shortcutkeymgr.ui +++ b/src/shortcutkeymgr.ui @@ -6,7 +6,7 @@ 0 0 - 766 + 476 508 @@ -57,6 +57,9 @@ QAbstractItemView::NoEditTriggers + + QAbstractItemView::SingleSelection + false @@ -101,6 +104,9 @@ QAbstractItemView::NoEditTriggers + + QAbstractItemView::SingleSelection + Function @@ -171,14 +177,6 @@ - - - TopToolBarArea - - - false - - -- Gitee From c3db4ae41d39dbbb02a2a94b36a093c03b68f4a7 Mon Sep 17 00:00:00 2001 From: cleverxiao Date: Tue, 14 Mar 2023 11:16:34 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E7=BE=8E=E5=8C=96=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cceditor/ccnotepad.cpp | 2 +- src/columnedit.cpp | 2 +- src/doctypelistview.cpp | 2 +- src/encodeconvert.cpp | 2 +- src/langstyledefine.cpp | 2 +- src/progresswin.cpp | 3 + src/renamewin.cpp | 8 +- src/renamewin.ui | 184 +++++++++++++++++++++---------------- src/shortcutkeyeditwin.cpp | 5 +- 9 files changed, 120 insertions(+), 90 deletions(-) diff --git a/src/cceditor/ccnotepad.cpp b/src/cceditor/ccnotepad.cpp index 23bafc6..b5ada36 100755 --- a/src/cceditor/ccnotepad.cpp +++ b/src/cceditor/ccnotepad.cpp @@ -7387,7 +7387,7 @@ void CCNotePad::slot_gotoline() int lineCounts = 2147483647; bool ok; - int num = QInputDialog::getInt(this, tr("Go to line"), tr("Line Num:"), 1, 1, lineCounts, 1, &ok); + int num = QInputDialog::getInt(this, tr("Go to line"), tr("Line Num:"), 1, 1, lineCounts, 1, &ok,Qt::WindowCloseButtonHint); if (ok) { diff --git a/src/columnedit.cpp b/src/columnedit.cpp index d607042..b9f74cf 100755 --- a/src/columnedit.cpp +++ b/src/columnedit.cpp @@ -7,7 +7,7 @@ ColumnEdit::ColumnEdit(QWidget *parent) ui.setupUi(this); connect(ui.addPrefix, &QCheckBox::stateChanged, this, &ColumnEdit::slot_addPrefix); - connect(ui.is16, &QRadioButton::clicked, this, &ColumnEdit::slot_bigChar); + connect(ui.is16, &QRadioButton::toggled, this, &ColumnEdit::slot_bigChar); } ColumnEdit::~ColumnEdit() diff --git a/src/doctypelistview.cpp b/src/doctypelistview.cpp index 3ab3ca2..59ab043 100755 --- a/src/doctypelistview.cpp +++ b/src/doctypelistview.cpp @@ -247,7 +247,7 @@ void DocTypeListView::slot_customContextMenuRequested(const QPoint& /*pos*/) void DocTypeListView::slot_addCustomType() { bool ok = false; - QString text = QInputDialog::getText(this, tr("input file ext()"), tr("ext (Split With :)"), QLineEdit::Normal, QString(".h:.cpp"), &ok); + QString text = QInputDialog::getText(this, tr("input file ext()"), tr("ext (Split With :)"), QLineEdit::Normal, QString(".h:.cpp"), &ok,Qt::WindowCloseButtonHint); if (ok && !text.isEmpty()) { diff --git a/src/encodeconvert.cpp b/src/encodeconvert.cpp index d08fd67..d8dd263 100755 --- a/src/encodeconvert.cpp +++ b/src/encodeconvert.cpp @@ -109,7 +109,7 @@ void EncodeConvert::slot_itemClicked(QTreeWidgetItem* item, int /*column*/) void EncodeConvert::slot_userDefineExt() { bool ok = false; - QString text = QInputDialog::getText(this, tr("input file ext()"),tr("ext (Split With :)"), QLineEdit::Normal, QString(".h:.cpp"), &ok); + QString text = QInputDialog::getText(this, tr("input file ext()"),tr("ext (Split With :)"), QLineEdit::Normal, QString(".h:.cpp"), &ok,Qt::WindowCloseButtonHint); if (ok && !text.isEmpty()) { diff --git a/src/langstyledefine.cpp b/src/langstyledefine.cpp index 3945159..bd0d34a 100755 --- a/src/langstyledefine.cpp +++ b/src/langstyledefine.cpp @@ -102,7 +102,7 @@ void LangStyleDefine::loadUserLangs() void LangStyleDefine::slot_new() { - QString name = QInputDialog::getText(this, tr("Create New Languages"), tr("Please Input Languages Name")); + QString name = QInputDialog::getText(this, tr("Create New Languages"), tr("Please Input Languages Name"),QLineEdit::Normal,QString(),nullptr,Qt::WindowCloseButtonHint); if (!name.isEmpty()) { diff --git a/src/progresswin.cpp b/src/progresswin.cpp index e8911ab..d57dd90 100755 --- a/src/progresswin.cpp +++ b/src/progresswin.cpp @@ -6,6 +6,9 @@ ProgressWin::ProgressWin(QWidget *parent) : QDialog(parent), m_curStep(0),m_isCancel(false) { ui.setupUi(this); + Qt::WindowFlags flags = Qt::Dialog; + flags |= Qt::WindowCloseButtonHint; + setWindowFlags(flags); } ProgressWin::~ProgressWin() diff --git a/src/renamewin.cpp b/src/renamewin.cpp index e0ff6bd..45c5a7c 100755 --- a/src/renamewin.cpp +++ b/src/renamewin.cpp @@ -19,6 +19,8 @@ ReNameWin::ReNameWin(QWidget *parent) connect(ui.radioButtonDelSuffix, &QRadioButton::toggled, this, [this](bool status) {slot_renameOptionsChange(4, status); }); connect(ui.radioButtonLower, &QRadioButton::toggled, this, [this](bool status) {slot_renameOptionsChange(5, status); }); connect(ui.radioButtonUpper, &QRadioButton::toggled, this, [this](bool status) {slot_renameOptionsChange(6, status); }); + + ui.radioButtonAddPrefix->toggled(true); } ReNameWin::~ReNameWin() @@ -55,7 +57,7 @@ void ReNameWin::slot_renameOptionsChange(int id, bool status) case 4: ui.lineEditDelSuffix->setEnabled(status); break; - default: + default: break; } } @@ -63,7 +65,7 @@ void ReNameWin::slot_renameOptionsChange(int id, bool status) void ReNameWin::slot_userDefineExt() { bool ok = false; - QString text = QInputDialog::getText(this, tr("input file ext()"), tr("ext (Start With .)"), QLineEdit::Normal, QString(".cpp"), &ok); + QString text = QInputDialog::getText(this, tr("input file ext()"), tr("ext (Start With .)"), QLineEdit::Normal, QString(".cpp"), &ok,Qt::WindowCloseButtonHint); if (ok && !text.isEmpty()) { @@ -216,7 +218,7 @@ void ReNameWin::changeFileName() return QString("%1/%2.%3").arg(dir.absolutePath()).arg(fi.baseName().toLower()).arg(fi.suffix()); case 5: return QString("%1/%2.%3").arg(dir.absolutePath()).arg(fi.baseName().toUpper()).arg(fi.suffix()); - default: + default: break; } return QString(); diff --git a/src/renamewin.ui b/src/renamewin.ui index 2717617..d7e1f53 100755 --- a/src/renamewin.ui +++ b/src/renamewin.ui @@ -38,6 +38,12 @@ + + + 0 + 0 + + Browse @@ -54,76 +60,96 @@ AddDelNameString - - - - - Add Prefix - - - - - - - false - - - - - - - Del Prefix - - - - - - - false - - - - - - - Add Suffix - - - - - - - false - - - - - - - Del Suffix - - - - - - - false - - + + + + + + + Add Prefix + + + true + + + + + + + false + + + + + + + Del Prefix + + + + + + + false + + + + + + + Add Suffix + + + + + + + false + + + + + + + Del Suffix + + + + + + + false + + + + + + + Lower FileName + + + + + + + Upper FileName + + + + - - - - Lower FileName + + + + Qt::Vertical - - - - - - Upper FileName + + + 20 + 35 + - + @@ -131,44 +157,40 @@ ChangeExt - + - - + + Modify Ext To - + - + Qt::Horizontal - 40 + 78 20 - - - - - + Deal Ext Type - + @@ -183,14 +205,14 @@ - + defined - + Qt::Horizontal diff --git a/src/shortcutkeyeditwin.cpp b/src/shortcutkeyeditwin.cpp index dd22277..0ede785 100755 --- a/src/shortcutkeyeditwin.cpp +++ b/src/shortcutkeyeditwin.cpp @@ -5,8 +5,11 @@ ShortcutKeyEditWin::ShortcutKeyEditWin(QWidget *parent) : QDialog(parent) { - ui.setupUi(this); + ui.setupUi(this); ui.keySequenceEdit->setFocus(); + Qt::WindowFlags flags = Qt::Dialog; + flags |= Qt::WindowCloseButtonHint; + setWindowFlags(flags); } ShortcutKeyEditWin::~ShortcutKeyEditWin() -- Gitee From 37c679892df53fc6755ab136bca1ee58c1f51108 Mon Sep 17 00:00:00 2001 From: ZhouXinLong <624029521@qq.com> Date: Tue, 29 Aug 2023 22:19:31 +0800 Subject: [PATCH 4/4] fork test --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 8a89b55..c908d80 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,8 @@ [中文 ](README.md) | [English](README_EN.md) ## 项目简介 - +Fork 这是一个使用C++编写的文本编辑器Notepad--,可以支持Win/Linux/Mac平台。 - 我们的目标是要进行文本编辑类软件的国产可替代,重点在国产Uos/Linux系统、Mac 系统上发展。 一个支持windows/linux/mac的文本编辑器,目标是要国产替换同类软件,来自中国。 -- Gitee