27 lines
588 B
C++
27 lines
588 B
C++
#pragma once
|
|
|
|
#include <QDateTime>
|
|
|
|
namespace Cevo {
|
|
|
|
// Equivalent of Common.Delay.pas's TDelay: a simple one-shot countdown.
|
|
class Delay {
|
|
public:
|
|
void start();
|
|
void stop();
|
|
bool isEnabled() const { return m_enabled; }
|
|
// NOTE: matches the original's TDelay.SetEnabled, which ignores its
|
|
// argument and always enables - kept as-is (transcribed literally).
|
|
void setEnabled(bool value);
|
|
bool isOverflowed() const;
|
|
bool isRunning() const;
|
|
|
|
int durationMs = 1000;
|
|
|
|
private:
|
|
QDateTime m_startTime;
|
|
bool m_enabled = false;
|
|
};
|
|
|
|
} // namespace Cevo
|