Replace dialog ok-cancel buttons with QDialogButtonBox

This PR will make button order follow the platform default.
For example: windows use: OK, Cancel; linux use: Cancel, OK.
This commit is contained in:
Chocobo1
2017-09-15 13:57:55 +08:00
parent 4eafe7a2c8
commit 7059b947e8
8 changed files with 75 additions and 208 deletions

View File

@@ -134,85 +134,19 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="loginButton">
<property name="text">
<string>Log in</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancelButton">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
<property name="centerButtons">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>cancelButton</sender>
<signal>clicked()</signal>
<receiver>authentication</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>245</x>
<y>195</y>
</hint>
<hint type="destinationlabel">
<x>179</x>
<y>230</y>
</hint>
</hints>
</connection>
<connection>
<sender>linePasswd</sender>
<signal>returnPressed()</signal>
<receiver>loginButton</receiver>
<slot>click()</slot>
<hints>
<hint type="sourcelabel">
<x>139</x>
<y>158</y>
</hint>
<hint type="destinationlabel">
<x>122</x>
<y>199</y>
</hint>
</hints>
</connection>
<connection>
<sender>lineUsername</sender>
<signal>returnPressed()</signal>