mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-20 13:08:50 +02:00
9249403c96
Ignore wheelEvent using subclass slider,spinbox,combobox with eventhandlers: wheelEvent - ignore if widget is not focused, leaveEvent - clear focus when mouse leaves event. Use these new subclass widgets in properties to ignore wheelEvent when scrolling.
20 lines
368 B
C++
20 lines
368 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);
|
|
}
|
|
|
|
void ComboBoxIgnoreScroll::leaveEvent(QEvent * event)
|
|
{
|
|
clearFocus();
|
|
}
|