From 4061887bfee1b0cd8d5b68197dc5316749732a99 Mon Sep 17 00:00:00 2001 From: AdavisSnakes <57366423+AdavisSnakes@users.noreply.github.com> Date: Sat, 6 Nov 2021 05:41:18 -0400 Subject: [PATCH] Removed info button globally (#2804) --- src/CutterApplication.cpp | 1 - src/core/MainWindow.cpp | 16 +++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/CutterApplication.cpp b/src/CutterApplication.cpp index f12539d1..2dccd156 100644 --- a/src/CutterApplication.cpp +++ b/src/CutterApplication.cpp @@ -52,7 +52,6 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc setAttribute(Qt::AA_UseHighDpiPixmaps); // always enabled on Qt >= 6.0.0 #endif setLayoutDirection(Qt::LeftToRight); - // WARN!!! Put initialization code below this line. Code above this line is mandatory to be run // First diff --git a/src/core/MainWindow.cpp b/src/core/MainWindow.cpp index e7cbe173..7d254031 100644 --- a/src/core/MainWindow.cpp +++ b/src/core/MainWindow.cpp @@ -619,7 +619,9 @@ bool MainWindow::openProject(const QString &file) const char *s = rz_project_err_message(err); QString msg = tr("Failed to open project: %1").arg(QString::fromUtf8(s)); RzListIter *it; - CutterRzListForeach(res, it, const char, s) { msg += "\n" + QString::fromUtf8(s); } + CutterRzListForeach (res, it, const char, s) { + msg += "\n" + QString::fromUtf8(s); + } QMessageBox::critical(this, tr("Open Project"), msg); rz_list_free(res); return false; @@ -1134,7 +1136,7 @@ void MainWindow::updateHistoryMenu(QMenu *menu, bool redo) bool history = true; QList actions; - CutterRzListForeach(list, it, RzCoreSeekItem, undo) { + CutterRzListForeach (list, it, RzCoreSeekItem, undo) { RzFlagItem *f = rz_flag_get_at(core->flags, undo->offset, true); char *fname = NULL; if (f) { @@ -1789,8 +1791,16 @@ void MainWindow::mousePressEvent(QMouseEvent *event) } } -bool MainWindow::eventFilter(QObject *, QEvent *event) +bool MainWindow::eventFilter(QObject *obj, QEvent *event) { + // For every create event - disable context help and proceed to next event check + if (event->type() == QEvent::Create) { + if (obj->isWidgetType()) { + auto w = static_cast(obj); + w->setWindowFlags(w->windowFlags() & (~Qt::WindowContextHelpButtonHint)); + } + } + if (event->type() == QEvent::MouseButtonPress) { QMouseEvent *mouseEvent = static_cast(event); if (mouseEvent->button() == Qt::ForwardButton || mouseEvent->button() == Qt::BackButton) {