Qt: Fix close button in settings not being translatable

This commit is contained in:
Connor McLaughlin 2020-10-03 01:13:18 +10:00
parent c051538d03
commit c6582bb7e4
2 changed files with 187 additions and 209 deletions

View file

@ -54,6 +54,7 @@ SettingsDialog::SettingsDialog(QtHostInterface* host_interface, QWidget* parent
m_ui.settingsContainer->setCurrentIndex(0); m_ui.settingsContainer->setCurrentIndex(0);
m_ui.helpText->setText(m_category_help_text[0]); m_ui.helpText->setText(m_category_help_text[0]);
connect(m_ui.settingsCategory, &QListWidget::currentRowChanged, this, &SettingsDialog::onCategoryCurrentRowChanged); connect(m_ui.settingsCategory, &QListWidget::currentRowChanged, this, &SettingsDialog::onCategoryCurrentRowChanged);
connect(m_ui.closeButton, &QPushButton::clicked, this, &SettingsDialog::accept);
} }
SettingsDialog::~SettingsDialog() = default; SettingsDialog::~SettingsDialog() = default;

View file

@ -26,12 +26,7 @@
<iconset resource="resources/resources.qrc"> <iconset resource="resources/resources.qrc">
<normaloff>:/icons/applications-system.png</normaloff>:/icons/applications-system.png</iconset> <normaloff>:/icons/applications-system.png</normaloff>:/icons/applications-system.png</iconset>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<property name="horizontalSpacing">
<number>10</number>
</property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QListWidget" name="settingsCategory"> <widget class="QListWidget" name="settingsCategory">
<property name="sizePolicy"> <property name="sizePolicy">
@ -203,12 +198,27 @@
</widget> </widget>
</item> </item>
<item row="2" column="0" colspan="2"> <item row="2" column="0" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="standardButtons"> <property name="sizeHint" stdset="0">
<set>QDialogButtonBox::Close|QDialogButtonBox::RestoreDefaults</set> <size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="closeButton">
<property name="text">
<string>Close</string>
</property>
<property name="default">
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
@ -219,38 +229,5 @@
<resources> <resources>
<include location="resources/resources.qrc"/> <include location="resources/resources.qrc"/>
</resources> </resources>
<connections> <connections/>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>SettingsDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>SettingsDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui> </ui>