Skip to content

Commit f4e74ab

Browse files
committed
showtextdlg: use QButonBox instead of QPushButton
1 parent a6ebd24 commit f4e74ab

File tree

2 files changed

+23
-31
lines changed

2 files changed

+23
-31
lines changed

src/showtextdlg.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ ShowTextDlg::ShowTextDlg(const QString &fname, bool rich, QWidget *parent) : QDi
3535
ui_.textEdit->setTextInteractionFlags(Qt::TextBrowserInteraction);
3636
}
3737

38-
connect(ui_.okButton, SIGNAL(clicked()), SLOT(accept()));
3938
resize(560, 384);
4039
}
4140

@@ -52,6 +51,5 @@ ShowTextDlg::ShowTextDlg(const QString &text, bool nonfile, bool rich, QWidget *
5251
ui_.textEdit->setTextInteractionFlags(Qt::TextBrowserInteraction);
5352
}
5453

55-
connect(ui_.okButton, SIGNAL(clicked()), SLOT(accept()));
5654
resize(560, 384);
5755
}

src/showtextdlg.ui

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -33,42 +33,36 @@
3333
<item>
3434
<layout class="QHBoxLayout" name="horizontalLayout">
3535
<item>
36-
<spacer name="spacerOkLeft">
37-
<property name="orientation">
38-
<enum>Qt::Horizontal</enum>
36+
<widget class="QDialogButtonBox" name="buttonBox">
37+
<property name="standardButtons">
38+
<set>QDialogButtonBox::Ok</set>
3939
</property>
40-
<property name="sizeHint" stdset="0">
41-
<size>
42-
<width>0</width>
43-
<height>0</height>
44-
</size>
45-
</property>
46-
</spacer>
47-
</item>
48-
<item>
49-
<widget class="QPushButton" name="okButton">
50-
<property name="text">
51-
<string>&amp;OK</string>
40+
<property name="centerButtons">
41+
<bool>true</bool>
5242
</property>
5343
</widget>
5444
</item>
55-
<item>
56-
<spacer name="spacerOkRight">
57-
<property name="orientation">
58-
<enum>Qt::Horizontal</enum>
59-
</property>
60-
<property name="sizeHint" stdset="0">
61-
<size>
62-
<width>0</width>
63-
<height>0</height>
64-
</size>
65-
</property>
66-
</spacer>
67-
</item>
6845
</layout>
6946
</item>
7047
</layout>
7148
</widget>
7249
<resources/>
73-
<connections/>
50+
<connections>
51+
<connection>
52+
<sender>buttonBox</sender>
53+
<signal>accepted()</signal>
54+
<receiver>ShowTextDlg</receiver>
55+
<slot>accept()</slot>
56+
<hints>
57+
<hint type="sourcelabel">
58+
<x>279</x>
59+
<y>352</y>
60+
</hint>
61+
<hint type="destinationlabel">
62+
<x>279</x>
63+
<y>191</y>
64+
</hint>
65+
</hints>
66+
</connection>
67+
</connections>
7468
</ui>

0 commit comments

Comments
 (0)