mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-10 06:39:49 +00:00
54 lines
1.2 KiB
C++
54 lines
1.2 KiB
C++
#include "dialoguespinbox.hpp"
|
|
|
|
#include <QWheelEvent>
|
|
|
|
CSVWorld::DialogueSpinBox::DialogueSpinBox(QWidget *parent) : QSpinBox(parent)
|
|
{
|
|
setFocusPolicy(Qt::StrongFocus);
|
|
}
|
|
|
|
void CSVWorld::DialogueSpinBox::focusInEvent(QFocusEvent *event)
|
|
{
|
|
setFocusPolicy(Qt::WheelFocus);
|
|
QSpinBox::focusInEvent(event);
|
|
}
|
|
|
|
void CSVWorld::DialogueSpinBox::focusOutEvent(QFocusEvent *event)
|
|
{
|
|
setFocusPolicy(Qt::StrongFocus);
|
|
QSpinBox::focusOutEvent(event);
|
|
}
|
|
|
|
void CSVWorld::DialogueSpinBox::wheelEvent(QWheelEvent *event)
|
|
{
|
|
if (!hasFocus())
|
|
event->ignore();
|
|
else
|
|
QSpinBox::wheelEvent(event);
|
|
}
|
|
|
|
CSVWorld::DialogueDoubleSpinBox::DialogueDoubleSpinBox(QWidget *parent) : QDoubleSpinBox(parent)
|
|
{
|
|
setFocusPolicy(Qt::StrongFocus);
|
|
}
|
|
|
|
void CSVWorld::DialogueDoubleSpinBox::focusInEvent(QFocusEvent *event)
|
|
{
|
|
setFocusPolicy(Qt::WheelFocus);
|
|
QDoubleSpinBox::focusInEvent(event);
|
|
}
|
|
|
|
void CSVWorld::DialogueDoubleSpinBox::focusOutEvent(QFocusEvent *event)
|
|
{
|
|
setFocusPolicy(Qt::StrongFocus);
|
|
QDoubleSpinBox::focusOutEvent(event);
|
|
}
|
|
|
|
void CSVWorld::DialogueDoubleSpinBox::wheelEvent(QWheelEvent *event)
|
|
{
|
|
if (!hasFocus())
|
|
event->ignore();
|
|
else
|
|
QDoubleSpinBox::wheelEvent(event);
|
|
}
|