From d5d9a4c08c095ca8672b81578195b883d16a57bf Mon Sep 17 00:00:00 2001 From: tenzap Date: Tue, 2 May 2023 10:04:37 +0200 Subject: [PATCH] use setWindowFlags() instead of setWindowFlag on Qt<5.9 Fixes: src/gui/CloneDialog.cpp:32:5: error: use of undeclared identifier 'setWindowFlag' setWindowFlag(Qt::WindowContextHelpButtonHint, false); ^ void QWidget::setWindowFlag(Qt::WindowType flag, bool on = true) --> This function was introduced in Qt 5.9. --- src/gui/CloneDialog.cpp | 4 ++++ src/gui/DatabaseOpenDialog.cpp | 4 ++++ src/gui/TotpSetupDialog.cpp | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/gui/CloneDialog.cpp b/src/gui/CloneDialog.cpp index 4ba5856bf..72199ae5a 100644 --- a/src/gui/CloneDialog.cpp +++ b/src/gui/CloneDialog.cpp @@ -29,7 +29,11 @@ CloneDialog::CloneDialog(DatabaseWidget* parent, Database* db, Entry* entry) m_ui->setupUi(this); window()->layout()->setSizeConstraint(QLayout::SetFixedSize); +#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0) setWindowFlag(Qt::WindowContextHelpButtonHint, false); +#else + setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); +#endif setAttribute(Qt::WA_DeleteOnClose); connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(close())); diff --git a/src/gui/DatabaseOpenDialog.cpp b/src/gui/DatabaseOpenDialog.cpp index acf905044..366f7a9cc 100644 --- a/src/gui/DatabaseOpenDialog.cpp +++ b/src/gui/DatabaseOpenDialog.cpp @@ -36,7 +36,11 @@ DatabaseOpenDialog::DatabaseOpenDialog(QWidget* parent) { setWindowTitle(tr("Unlock Database - KeePassXC")); setWindowFlags(Qt::Dialog); +#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0) setWindowFlag(Qt::WindowContextHelpButtonHint, false); +#else + setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); +#endif #ifdef Q_OS_LINUX // Linux requires this to overcome some Desktop Environments (also no Quick Unlock) setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); diff --git a/src/gui/TotpSetupDialog.cpp b/src/gui/TotpSetupDialog.cpp index 875dfcfd0..d33d9ce39 100644 --- a/src/gui/TotpSetupDialog.cpp +++ b/src/gui/TotpSetupDialog.cpp @@ -29,7 +29,11 @@ TotpSetupDialog::TotpSetupDialog(QWidget* parent, Entry* entry) { m_ui->setupUi(this); setAttribute(Qt::WA_DeleteOnClose); +#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0) setWindowFlag(Qt::WindowContextHelpButtonHint, false); +#else + setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); +#endif setFixedSize(sizeHint()); connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(close()));