Fix the button order in the "Choose Topic" dialog (help plugin)

Currently, the Display (confirm) button is located on the left of the
Close button on all platforms. This looks odd on macOS, as the
confirmation buttons are normally located at the very right there.
This commit fixes this issue by using a QDialogButtonBox to display
the buttons.

Task-number: QTCREATORBUG-10440
Change-Id: I453e01d9cce01ad2f5620099defa0e71477398b7
Reviewed-by: Michael Winkelmann <michael.winkelmann@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Nicolas Ettlin
2018-07-12 13:20:22 +02:00
parent b6c9879f41
commit 5b6ab4ced2
2 changed files with 6 additions and 48 deletions

View File

@@ -64,9 +64,9 @@ TopicChooser::TopicChooser(QWidget *parent, const QString &keyword,
if (m_filterModel->rowCount() != 0)
ui.listWidget->setCurrentIndex(m_filterModel->index(0, 0));
connect(ui.buttonDisplay, &QPushButton::clicked,
connect(ui.buttonBox, &QDialogButtonBox::accepted,
this, &TopicChooser::acceptDialog);
connect(ui.buttonCancel, &QPushButton::clicked,
connect(ui.buttonBox, &QDialogButtonBox::rejected,
this, &TopicChooser::reject);
connect(ui.listWidget, &QListView::activated,
this, &TopicChooser::activated);

View File

@@ -34,53 +34,11 @@
<widget class="QListView" name="listWidget"/>
</item>
<item>
<layout class="QHBoxLayout" name="unnamed">
<property name="spacing">
<number>6</number>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<spacer name="Horizontal Spacing2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="buttonDisplay">
<property name="text">
<string>&amp;Display</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonCancel">
<property name="text">
<string>&amp;Close</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>