For the "ignore wheel" widgets, do not leave focus on mouse leave events. This causes unintended side effects such as not being able to type in edit boxes, and is very annoying.
15 lines
294 B
C++
15 lines
294 B
C++
#include "comboBox-ignorewheel.hpp"
|
|
|
|
ComboBoxIgnoreScroll::ComboBoxIgnoreScroll(QWidget *parent) : QComboBox(parent)
|
|
{
|
|
setFocusPolicy(Qt::StrongFocus);
|
|
}
|
|
|
|
void ComboBoxIgnoreScroll::wheelEvent(QWheelEvent * event)
|
|
{
|
|
if (!hasFocus())
|
|
event->ignore();
|
|
else
|
|
QComboBox::wheelEvent(event);
|
|
}
|