From 5b6ab4ced2246ce5a3a37df99bad837e1189a7f6 Mon Sep 17 00:00:00 2001 From: Nicolas Ettlin Date: Thu, 12 Jul 2018 13:20:22 +0200 Subject: [PATCH] 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 Reviewed-by: Eike Ziller --- src/shared/help/topicchooser.cpp | 4 +-- src/shared/help/topicchooser.ui | 50 +++----------------------------- 2 files changed, 6 insertions(+), 48 deletions(-) diff --git a/src/shared/help/topicchooser.cpp b/src/shared/help/topicchooser.cpp index 6b24ab5f38b..b7e5db7f3fe 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 57ab39b3945..b288f8334c3 100644 --- a/src/shared/help/topicchooser.ui +++ b/src/shared/help/topicchooser.ui @@ -34,53 +34,11 @@ - - - 6 + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - 0 - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - - - &Display - - - true - - - true - - - - - - - &Close - - - true - - - - +