feat: 带符号编译体积优化;UI 小问题调整;

This commit is contained in:
寂静的羽夏 2025-03-26 13:41:24 +08:00
parent 9a3d1c040a
commit b63cb626d1
12 changed files with 41 additions and 46 deletions

View File

@ -6,7 +6,7 @@ on:
- release
env:
BUILD_TYPE: RelWithDebInfo
BUILD_TYPE: Release
jobs:
build-release:

View File

@ -6,7 +6,7 @@ on:
- release
env:
BUILD_TYPE: RelWithDebInfo
BUILD_TYPE: Release
jobs:
build-release:

View File

@ -9,7 +9,7 @@ on:
- main
env:
BUILD_TYPE: RelWithDebInfo
BUILD_TYPE: Release
jobs:
build-test:

View File

@ -17,18 +17,7 @@ find_package(
Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Network Concurrent
PrintSupport Xml LinguistTools)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
message("Build ${PROJECT_NAME} with ${CMAKE_BUILD_TYPE}.")
elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
message("Build ${PROJECT_NAME} with ${CMAKE_BUILD_TYPE}.")
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
message(
WARNING
"${PROJECT_NAME}'s stacktrace won't work built with ${CMAKE_BUILD_TYPE}."
)
else()
message(FATAL_ERROR "Unsupported build type!")
endif()
message("Build ${PROJECT_NAME} with ${CMAKE_BUILD_TYPE}.")
install(CODE "set(CMAKE_INSTALL_LOCAL_ONLY TRUE)" ALL_COMPONENTS)
@ -507,6 +496,14 @@ else()
endif()
endif()
target_compile_options(
WingHexExplorer2
PRIVATE $<$<AND:$<NOT:$<CXX_COMPILER_ID:MSVC>>,$<CONFIG:Release>>:-g>
$<$<CXX_COMPILER_ID:MSVC>:$<$<CONFIG:Release>:/Zi>>)
target_link_options(WingHexExplorer2 PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:$<$<CONFIG:Release>:/DEBUG>>)
target_link_libraries(
${CMAKE_PROJECT_NAME}
PRIVATE Qt${QT_VERSION_MAJOR}::Widgets

@ -1 +1 @@
Subproject commit f58ba0b04c7d11c9221386d0aaec44479466c454
Subproject commit 8e392b3609f39a987fa2e52e3dcf782eb5a07850

View File

@ -572,47 +572,47 @@
<translation></translation>
</message>
<message>
<location filename="../../src/dialog/finddialog.cpp" line="50"/>
<location filename="../../src/dialog/finddialog.cpp" line="51"/>
<source>EncBytes:</source>
<translation></translation>
</message>
<message>
<location filename="../../src/dialog/finddialog.cpp" line="96"/>
<location filename="../../src/dialog/finddialog.cpp" line="97"/>
<source>Region:</source>
<translation></translation>
</message>
<message>
<location filename="../../src/dialog/finddialog.cpp" line="128"/>
<location filename="../../src/dialog/finddialog.cpp" line="129"/>
<source>None</source>
<translation></translation>
</message>
<message>
<location filename="../../src/dialog/finddialog.cpp" line="139"/>
<location filename="../../src/dialog/finddialog.cpp" line="140"/>
<source>Region</source>
<translation></translation>
</message>
<message>
<location filename="../../src/dialog/finddialog.cpp" line="151"/>
<location filename="../../src/dialog/finddialog.cpp" line="152"/>
<source>BeforeCursor</source>
<translation></translation>
</message>
<message>
<location filename="../../src/dialog/finddialog.cpp" line="161"/>
<location filename="../../src/dialog/finddialog.cpp" line="162"/>
<source>AfterCursor</source>
<translation></translation>
</message>
<message>
<location filename="../../src/dialog/finddialog.cpp" line="171"/>
<location filename="../../src/dialog/finddialog.cpp" line="172"/>
<source>Selection</source>
<translation></translation>
</message>
<message>
<location filename="../../src/dialog/finddialog.cpp" line="204"/>
<location filename="../../src/dialog/finddialog.cpp" line="205"/>
<source>find</source>
<translation></translation>
</message>
<message>
<location filename="../../src/dialog/finddialog.cpp" line="218"/>
<location filename="../../src/dialog/finddialog.cpp" line="219"/>
<source>InvalidHexSeq</source>
<translation></translation>
</message>

View File

@ -572,47 +572,47 @@
<translation></translation>
</message>
<message>
<location filename="../../src/dialog/finddialog.cpp" line="50"/>
<location filename="../../src/dialog/finddialog.cpp" line="51"/>
<source>EncBytes:</source>
<translation></translation>
</message>
<message>
<location filename="../../src/dialog/finddialog.cpp" line="96"/>
<location filename="../../src/dialog/finddialog.cpp" line="97"/>
<source>Region:</source>
<translation></translation>
</message>
<message>
<location filename="../../src/dialog/finddialog.cpp" line="128"/>
<location filename="../../src/dialog/finddialog.cpp" line="129"/>
<source>None</source>
<translation></translation>
</message>
<message>
<location filename="../../src/dialog/finddialog.cpp" line="139"/>
<location filename="../../src/dialog/finddialog.cpp" line="140"/>
<source>Region</source>
<translation></translation>
</message>
<message>
<location filename="../../src/dialog/finddialog.cpp" line="151"/>
<location filename="../../src/dialog/finddialog.cpp" line="152"/>
<source>BeforeCursor</source>
<translation></translation>
</message>
<message>
<location filename="../../src/dialog/finddialog.cpp" line="161"/>
<location filename="../../src/dialog/finddialog.cpp" line="162"/>
<source>AfterCursor</source>
<translation></translation>
</message>
<message>
<location filename="../../src/dialog/finddialog.cpp" line="171"/>
<location filename="../../src/dialog/finddialog.cpp" line="172"/>
<source>Selection</source>
<translation></translation>
</message>
<message>
<location filename="../../src/dialog/finddialog.cpp" line="204"/>
<location filename="../../src/dialog/finddialog.cpp" line="205"/>
<source>find</source>
<translation></translation>
</message>
<message>
<location filename="../../src/dialog/finddialog.cpp" line="218"/>
<location filename="../../src/dialog/finddialog.cpp" line="219"/>
<source>InvalidHexSeq</source>
<translation></translation>
</message>

View File

@ -128,16 +128,20 @@ def main():
exemain_src = ""
exesym_src = ""
exeplg_src = ""
exeplg_pdb = ""
if (os.path.exists(os.path.join(projectdeb, "WingHexExplorer2.sln"))):
exemain_src = os.path.join(projectdeb, "RelWithDebInfo", exe_name)
exesym_src = os.path.join(projectdeb, "RelWithDebInfo", sym_name)
exemain_src = os.path.join(projectdeb, "Release", exe_name)
exesym_src = os.path.join(projectdeb, "Release", sym_name)
exeplg_src = os.path.join(
projectdeb, "WingPlugin", "RelWithDebInfo", "WingPlugin.dll")
projectdeb, "WingPlugin", "Release", "WingPlugin.dll")
exeplg_pdb = os.path.join(
projectdeb, "WingPlugin", "Release", "WingPlugin.pdb")
else:
exemain_src = os.path.join(projectdeb, exe_name)
exesym_src = os.path.join(projectdeb, sym_name)
exeplg_src = os.path.join(projectdeb, "WingPlugin", "WingPlugin.dll")
exeplg_pdb = os.path.join(projectdeb, "WingPlugin", "WingPlugin.pdb")
if (os.path.exists(exemain_src) == False):
print(
@ -163,6 +167,7 @@ def main():
shutil.copy2(exesym_src, os.path.join(exeDebPath, sym_name))
shutil.copy2(exeplg_src,
os.path.join(exeDebPath, "WingPlugin.dll"))
shutil.copyfile(exeplg_pdb, os.path.join(exeDebPath, "WingPlugin.pdb"))
shutil.copytree(os.path.join(buildinstaller, "share"),
os.path.join(exeDebPath, "share"))

View File

@ -56,6 +56,7 @@ void ASObjTreeWidget::setEngine(asIScriptEngine *engine) {
}
setSortingEnabled(true);
resizeColumnToContents(0);
}
QTreeWidgetItem *ASObjTreeWidget::createObjNode(const CodeInfoTip &node,

View File

@ -97,13 +97,6 @@ void QHexTextEdit::mousePressEvent(QMouseEvent *event) {
setTextCursor(cursor);
}
QSize QHexTextEdit::sizeHint() const {
QFont font = this->font();
QFontMetrics fontMetrics(font);
int lineHeight = fontMetrics.lineSpacing();
return QSize(0, lineHeight);
}
bool QHexTextEdit::isHexMode() const { return m_isHexMode; }
void QHexTextEdit::setIsHexMode(bool newIsHexMode) {

View File

@ -32,8 +32,6 @@ protected:
void keyPressEvent(QKeyEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;
QSize sizeHint() const override;
private:
QString mText;
int mCurserPositionPre;

View File

@ -44,6 +44,7 @@ FindDialog::FindDialog(const FindInfo &info, QWidget *parent)
layout->addWidget(new QLabel(tr("Content:"), this));
m_lineeditor = new QHexTextEdit(this);
m_lineeditor->setFixedHeight(m_findMode->height());
layout->addWidget(m_lineeditor);
layout->addSpacing(3);