Files
newspark110/customcontrols/dmspinbox.cpp
Chenwenxuan edac2715f0 init
2024-03-06 14:54:30 +08:00

31 lines
754 B
C++

#include "dmspinbox.h"
#include "eventfilterwheel.h"
#include <QDebug>
#include <QEvent>
DMSpinBox::DMSpinBox(QWidget *parent) :
QSpinBox(parent) {
installEventFilter(new EventFilterWheel());
setFocusPolicy(Qt::StrongFocus);
setKeyboardTracking(false);
installEventFilter(this);
}
#ifdef QT_DEBUG
bool DMSpinBox::eventFilter(QObject *watched, QEvent *event)
{
// Q_UNUSED(watched)
// QDoubleSpinBox *castSBox = static_cast<QDoubleSpinBox*>(watched);
if(event->type()==QEvent::Timer)
{
QTimerEvent *tEvent = static_cast<QTimerEvent*>(event);
if(tEvent)
qDebug() << "<--QEvent::Timer-->" << tEvent->timerId();
return true;
}
return QObject::eventFilter(watched,event);
}
#endif