mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-26 10:35:55 -05:00
Disable combobox scroll hijacking, and only show one event by default (rather than all)
This commit is contained in:
15
noscrollcombobox.cpp
Normal file
15
noscrollcombobox.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "noscrollcombobox.h"
|
||||
|
||||
NoScrollComboBox::NoScrollComboBox(QWidget *parent)
|
||||
: QComboBox(parent)
|
||||
{
|
||||
// Don't let scrolling hijack focus.
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
}
|
||||
|
||||
void NoScrollComboBox::wheelEvent(QWheelEvent *event)
|
||||
{
|
||||
// Only allow scrolling to modify contents when it explicitly has focus.
|
||||
if (hasFocus())
|
||||
QComboBox::wheelEvent(event);
|
||||
}
|
||||
Reference in New Issue
Block a user