Config: Fix expression window scroll wheel spam

Fixes the expression window being spammed with the first entry in the
Operators or Functions select menus when scrolling the mouse wheel while
hovering over them.

Fixes https://bugs.dolphin-emu.org/issues/12405
This commit is contained in:
Dentomologist
2021-02-03 20:11:38 -08:00
parent b6e9cca64f
commit 43b389410a
2 changed files with 19 additions and 3 deletions

View File

@ -7,6 +7,7 @@
#include <memory>
#include <string>
#include <QComboBox>
#include <QDialog>
#include <QString>
#include <QSyntaxHighlighter>
@ -17,7 +18,6 @@
class ControlReference;
class MappingWidget;
class QAbstractButton;
class QComboBox;
class QDialogButtonBox;
class QLineEdit;
class QTableWidget;
@ -45,6 +45,17 @@ protected:
void highlightBlock(const QString& text) final override;
};
class QComboBoxWithMouseWheelDisabled : public QComboBox
{
Q_OBJECT
public:
explicit QComboBoxWithMouseWheelDisabled(QWidget* parent = nullptr) : QComboBox(parent) {}
protected:
// Consumes event while doing nothing
void wheelEvent(QWheelEvent* event) override;
};
class IOWindow final : public QDialog
{
Q_OBJECT