summaryrefslogtreecommitdiff
path: root/src/shared/help
diff options
context:
space:
mode:
authorNicolas Ettlin <nicolas.ettlin@me.com>2018-07-12 13:20:22 +0200
committerNicolas Ettlin <nicolas.ettlin@me.com>2018-07-18 13:04:55 +0000
commit5b6ab4ced2246ce5a3a37df99bad837e1189a7f6 (patch)
tree0a8b5ed85cf5273badc0a7006442d43c9f709901 /src/shared/help
parentb6c9879f41f15ffea296be96d722efdba0090cf6 (diff)
downloadqt-creator-5b6ab4ced2246ce5a3a37df99bad837e1189a7f6.tar.gz
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>
Diffstat (limited to 'src/shared/help')
-rw-r--r--src/shared/help/topicchooser.cpp4
-rw-r--r--src/shared/help/topicchooser.ui50
2 files changed, 6 insertions, 48 deletions
diff --git a/src/shared/help/topicchooser.cpp b/src/shared/help/topicchooser.cpp
index 6b24ab5f38..b7e5db7f3f 100644
--- a/src/shared/help/topicchooser.cpp
+++ b/src/shared/help/topicchooser.cpp
@@ -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);
diff --git a/src/shared/help/topicchooser.ui b/src/shared/help/topicchooser.ui
index 57ab39b394..b288f8334c 100644
--- a/src/shared/help/topicchooser.ui
+++ b/src/shared/help/topicchooser.ui
@@ -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>