init
This commit is contained in:
30
customcontrols/dmspinbox.cpp
Normal file
30
customcontrols/dmspinbox.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user