#include "update_dc_event.h"

QEvent::Type UpdateDcEvent::customEventType = QEvent::None;

UpdateDcEvent::UpdateDcEvent(QObject const *sender,
                             UpdateStep updateStep,
                             int count,
                             QDateTime const &sendDateTime)
    : QEvent(UpdateDcEvent::type())
    , m_sender(sender)
    , m_updateStep(updateStep)
    , m_count(count)
    , m_sendDateTime(sendDateTime) {
}

UpdateDcEvent::~UpdateDcEvent() {
}

QEvent::Type UpdateDcEvent::type() {
    if (customEventType == QEvent::None) {
        int generatedType = QEvent::registerEventType();
        customEventType = static_cast<QEvent::Type>(generatedType);
    }
    return customEventType;
}
