1
0

refactor: set openExternalLinks in ui file instead of cpp file

This commit is contained in:
2026-07-06 20:41:58 +08:00
parent 319fd64fc6
commit 31303a20c7
2 changed files with 25 additions and 14 deletions

View File

@@ -73,19 +73,10 @@ AboutDialog::AboutDialog(QWidget *parent)
.arg(tr("Some of them are optional and might not be included with this distribution depending on the build environment.")); .arg(tr("Some of them are optional and might not be included with this distribution depending on the build environment."));
ui->m_helpTextEdit->setHtml(HELP_HTML); ui->m_helpTextEdit->setHtml(HELP_HTML);
ui->m_helpTextEdit->setOpenExternalLinks(false);
ui->m_aboutTextEdit->setHtml(ABOUT_HTML); ui->m_aboutTextEdit->setHtml(ABOUT_HTML);
ui->m_aboutTextEdit->setOpenExternalLinks(true);
ui->m_specialThanksTextEdit->setHtml(SPECIAL_THANKS_HTML); ui->m_specialThanksTextEdit->setHtml(SPECIAL_THANKS_HTML);
ui->m_specialThanksTextEdit->setOpenExternalLinks(true);
ui->m_licenseTextEdit->setHtml(LICENSE_HTML); ui->m_licenseTextEdit->setHtml(LICENSE_HTML);
ui->m_licenseTextEdit->setOpenExternalLinks(false);
ui->m_3rdPartyLibsTextEdit->setHtml(THIRD_PARTY_LIBS_HTML); ui->m_3rdPartyLibsTextEdit->setHtml(THIRD_PARTY_LIBS_HTML);
ui->m_3rdPartyLibsTextEdit->setOpenExternalLinks(true);
connect(ui->m_buttonBox, QOverload<QAbstractButton *>::of(&QDialogButtonBox::clicked), this, [this](QAbstractButton * btn){ connect(ui->m_buttonBox, QOverload<QAbstractButton *>::of(&QDialogButtonBox::clicked), this, [this](QAbstractButton * btn){
Q_UNUSED(btn) Q_UNUSED(btn)

View File

@@ -26,7 +26,11 @@
</attribute> </attribute>
<layout class="QVBoxLayout" name="helpTabLayout"> <layout class="QVBoxLayout" name="helpTabLayout">
<item> <item>
<widget class="QTextBrowser" name="m_helpTextEdit"/> <widget class="QTextBrowser" name="m_helpTextEdit">
<property name="openExternalLinks">
<bool>false</bool>
</property>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -36,7 +40,11 @@
</attribute> </attribute>
<layout class="QVBoxLayout" name="aboutTabLayout"> <layout class="QVBoxLayout" name="aboutTabLayout">
<item> <item>
<widget class="QTextBrowser" name="m_aboutTextEdit"/> <widget class="QTextBrowser" name="m_aboutTextEdit">
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -46,7 +54,11 @@
</attribute> </attribute>
<layout class="QVBoxLayout" name="specialThanksTabLayout"> <layout class="QVBoxLayout" name="specialThanksTabLayout">
<item> <item>
<widget class="QTextBrowser" name="m_specialThanksTextEdit"/> <widget class="QTextBrowser" name="m_specialThanksTextEdit">
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -56,7 +68,11 @@
</attribute> </attribute>
<layout class="QVBoxLayout" name="licenseTabLayout"> <layout class="QVBoxLayout" name="licenseTabLayout">
<item> <item>
<widget class="QTextBrowser" name="m_licenseTextEdit"/> <widget class="QTextBrowser" name="m_licenseTextEdit">
<property name="openExternalLinks">
<bool>false</bool>
</property>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -66,7 +82,11 @@
</attribute> </attribute>
<layout class="QVBoxLayout" name="thirdPartyLibsTabLayout"> <layout class="QVBoxLayout" name="thirdPartyLibsTabLayout">
<item> <item>
<widget class="QTextBrowser" name="m_3rdPartyLibsTextEdit"/> <widget class="QTextBrowser" name="m_3rdPartyLibsTextEdit">
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>