Mercurial > public > ostc_companion
diff Utils/LogEvent.cpp @ 1:0b3630a29ad8
Initial version based on previous repository.
Project was ported to QT6 and in now cmake based.
| author | Ideenmodellierer <tiefenrauscher@web.de> |
|---|---|
| date | Thu, 27 Nov 2025 18:40:28 +0100 |
| parents | |
| children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Utils/LogEvent.cpp Thu Nov 27 18:40:28 2025 +0100 @@ -0,0 +1,31 @@ +///////////////////////////////////////////////////////////////////////////// +/// \file LogEvent.cpp +/// \brief User event to pass async messages to the console widget. +/// \author JD Gascuel. +/// \copyright (c) 2015 JD Gascuel. All rights reserved. +/// $Id$ +/////////////////////////////////////////////////////////////////////////////// + +#include "LogEvent.h" +#include <QEvent> + +////////////////////////////////////////////////////////////////////////////// + +QEvent::Type LogEvent::_logEventType = QEvent::None; + +////////////////////////////////////////////////////////////////////////////// + +LogEvent::LogEvent(const QString& message) + : QEvent(_logEventType), + _message(message) +{ +} + +////////////////////////////////////////////////////////////////////////////// + +LogEvent* LogEvent::make(const QString& message) +{ + if( _logEventType == QEvent::None ) + _logEventType = (QEvent::Type) QEvent::registerEventType(); + return new LogEvent(message); +}
