supercell-wx/scwx-qt/source/scwx/qt/ui/widgets/focused_combo_box.hpp
2025-05-25 18:14:33 -04:00

25 lines
358 B
C++

#pragma once
#include <QComboBox>
#include <QWheelEvent>
class QFocusedComboBox : public QComboBox
{
Q_OBJECT
public:
using QComboBox::QComboBox;
protected:
void wheelEvent(QWheelEvent* event) override
{
if (hasFocus())
{
QComboBox::wheelEvent(event);
}
else
{
event->ignore();
}
}
};