From 4a49c5b1694e1740d63e24c757f12c0a10ebdf53 Mon Sep 17 00:00:00 2001 From: ts-korhonen Date: Sat, 5 Feb 2022 22:56:43 +0200 Subject: [PATCH] qt: disable window context help buttons --- src/qt/qt_styleoverride.cpp | 7 +++++++ src/qt/qt_styleoverride.hpp | 3 +++ 2 files changed, 10 insertions(+) diff --git a/src/qt/qt_styleoverride.cpp b/src/qt/qt_styleoverride.cpp index 85727b9ac..449b167aa 100644 --- a/src/qt/qt_styleoverride.cpp +++ b/src/qt/qt_styleoverride.cpp @@ -11,4 +11,11 @@ int StyleOverride::styleHint( return 0; return QProxyStyle::styleHint(hint, option, widget, returnData); +} + +void StyleOverride::polish(QWidget* widget) +{ + /* Disable title bar context help buttons globally as they are unused. */ + if (widget->isWindow()) + widget->setWindowFlag(Qt::WindowContextHelpButtonHint, false); } \ No newline at end of file diff --git a/src/qt/qt_styleoverride.hpp b/src/qt/qt_styleoverride.hpp index 46a73fa4e..fa365d946 100644 --- a/src/qt/qt_styleoverride.hpp +++ b/src/qt/qt_styleoverride.hpp @@ -2,6 +2,7 @@ #define QT_STYLEOVERRIDE_HPP #include +#include class StyleOverride : public QProxyStyle { @@ -11,6 +12,8 @@ public: const QStyleOption *option = nullptr, const QWidget *widget = nullptr, QStyleHintReturn *returnData = nullptr) const override; + + void polish(QWidget* widget) override; }; #endif \ No newline at end of file