34 m_maxTime(24 * 3600 - 1),
42 setToolTip(
tr(
"Use mouse scroll or UP/DOWN arrow keys to change time in small steps.\nCTRL + scroll or PAGE UP/DOWN keys to change time in larger steps."));
105 div_t qrM = div(abs(seconds), 60);
106 div_t qrH = div(qrM.quot, 60);
123 if (
text().compare(val)) {
134 int s = seconds + cs;
147 if (minSeconds <= maxSeconds && (
m_minTime != minSeconds ||
m_maxTime != maxSeconds)) {
149 if (maxSeconds >= 3600)
150 digits = floorf(logf(round(maxSeconds / 3600)) / logf(10.0f)) + 1;
152 bool mod = (
m_hourDigits != digits || std::signbit((
float)
m_minTime) != std::signbit((
float)minSeconds));
199 QString inputRe =
"(?<mins>[0-5][0-9])";
204 inputRe.
prepend(
"(?<hrs>[0-9]*[0-9]):");
213 inputRe.
append(
":(?<secs>[0-5][0-9])");
215 suffx.
append(
":\\" %
tr(
"s") %
"\\" %
tr(
"s"));
218 inputRe.
prepend(
"(?<pol>-|\\+|\\s)?");
223 inputRe.
append(
"\\s?\\[[^\\]]+\\]$");
224 inputMsk.
append(
" \\[" % suffx %
"\\]");
239 switch (
event->key()) {
273 if (
event->angleDelta().isNull()) {
277 int numSteps = -
event->angleDelta().y() / 8 / 15 * -1;
QString captured(int nth) const const
QString & append(QChar ch)
int timepart(const QString &input, TimeParts part) const
void keyPressEvent(QKeyEvent *event) override
QString text() const const
void incrDecr(int seconds)
virtual bool event(QEvent *e) override
QString & prepend(QChar ch)
void setShowSeconds(bool showSeconds)
int timeInSeconds() const
TimerEdit(QWidget *parent=Q_NULLPTR)
void setTime(int seconds)
virtual void keyPressEvent(QKeyEvent *event) override
void setMaximumTime(int maxSeconds)
int toInt(bool *ok, int base) const const
bool isEmpty() const const
bool hasMatch() const const
void textEdited(const QString &text)
void setMinimumTime(int minSeconds)
QRegularExpressionValidator * m_validator
QString tr(const char *s, const char *c, int n)
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
int compare(const QString &other, Qt::CaseSensitivity cs) const const
void wheelEvent(QWheelEvent *event) override
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
void setValidator(const QValidator *v)
void setTimeRange(int minSeconds, int maxSeconds)