qt: disable window context help buttons

This commit is contained in:
ts-korhonen
2022-02-05 22:56:43 +02:00
parent 2ad137725a
commit 4a49c5b169
2 changed files with 10 additions and 0 deletions

View File

@@ -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);
}

View File

@@ -2,6 +2,7 @@
#define QT_STYLEOVERRIDE_HPP
#include <QProxyStyle>
#include <QWidget>
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