main: Globally disable the "?" button on dialogs (#6263)

Sets the AA_DisableWindowContextHelpButton attribute to disable this useless button globally. This is disabled by default on Qt6.
This commit is contained in:
Morph 2023-01-28 11:08:15 -05:00 committed by GitHub
parent 0f6478a928
commit bb8cb3ff82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 9 deletions

View file

@ -17,7 +17,6 @@ CheatDialog::CheatDialog(QWidget* parent)
: QDialog(parent), ui(std::make_unique<Ui::CheatDialog>()) { : QDialog(parent), ui(std::make_unique<Ui::CheatDialog>()) {
// Setup gui control settings // Setup gui control settings
ui->setupUi(this); ui->setupUi(this);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
ui->tableCheats->setColumnWidth(0, 30); ui->tableCheats->setColumnWidth(0, 30);
ui->tableCheats->setColumnWidth(2, 85); ui->tableCheats->setColumnWidth(2, 85);
ui->tableCheats->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Fixed); ui->tableCheats->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Fixed);

View file

@ -20,8 +20,6 @@ ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry, bool
PopulateSelectionList(); PopulateSelectionList();
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
connect(ui->uiTab, &ConfigureUi::LanguageChanged, this, &ConfigureDialog::OnLanguageChanged); connect(ui->uiTab, &ConfigureUi::LanguageChanged, this, &ConfigureDialog::OnLanguageChanged);
connect(ui->selectorList, &QListWidget::itemSelectionChanged, this, connect(ui->selectorList, &QListWidget::itemSelectionChanged, this,
&ConfigureDialog::UpdateVisibleTabs); &ConfigureDialog::UpdateVisibleTabs);

View file

@ -41,8 +41,6 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const QString
setFocusPolicy(Qt::ClickFocus); setFocusPolicy(Qt::ClickFocus);
setWindowTitle(tr("Properties")); setWindowTitle(tr("Properties"));
// remove Help question mark button from the title bar
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
scene = new QGraphicsScene; scene = new QGraphicsScene;
ui->icon_view->setScene(scene); ui->icon_view->setScene(scene);

View file

@ -50,9 +50,8 @@ MicroProfileDialog::MicroProfileDialog(QWidget* parent) : QWidget(parent, Qt::Di
setObjectName(QStringLiteral("MicroProfile")); setObjectName(QStringLiteral("MicroProfile"));
setWindowTitle(tr("MicroProfile")); setWindowTitle(tr("MicroProfile"));
resize(1000, 600); resize(1000, 600);
// Remove the "?" button from the titlebar and enable the maximize button // Enable the maximize button
setWindowFlags((windowFlags() & ~Qt::WindowContextHelpButtonHint) | setWindowFlags(windowFlags() | Qt::WindowMaximizeButtonHint);
Qt::WindowMaximizeButtonHint);
#if MICROPROFILE_ENABLED #if MICROPROFILE_ENABLED

View file

@ -2644,6 +2644,10 @@ int main(int argc, char* argv[]) {
#ifdef __APPLE__ #ifdef __APPLE__
std::string bin_path = FileUtil::GetBundleDirectory() + DIR_SEP + ".."; std::string bin_path = FileUtil::GetBundleDirectory() + DIR_SEP + "..";
chdir(bin_path.c_str()); chdir(bin_path.c_str());
#endif
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
// Disables the "?" button on all dialogs. Disabled by default on Qt6.
QCoreApplication::setAttribute(Qt::AA_DisableWindowContextHelpButton);
#endif #endif
QCoreApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity); QCoreApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity);
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts); QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);

View file

@ -9,7 +9,6 @@
SequenceDialog::SequenceDialog(QWidget* parent) : QDialog(parent) { SequenceDialog::SequenceDialog(QWidget* parent) : QDialog(parent) {
setWindowTitle(tr("Enter a hotkey")); setWindowTitle(tr("Enter a hotkey"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
key_sequence = new QKeySequenceEdit; key_sequence = new QKeySequenceEdit;