#include "progress_event.h"

QEvent::Type ProgressEvent::customEventType = QEvent::None;

ProgressEvent::ProgressEvent(QObject const *sender, int progressPercent)
    : QEvent(ProgressEvent::type())
    , m_sender(sender)
    , m_progressPercent(progressPercent) {
}

ProgressEvent::~ProgressEvent() {
}

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