In event list, use only number of digits needed for event count

This commit is contained in:
Seeker4 2019-08-29 07:21:19 -07:00
parent c1b4137857
commit 3cf038cb70

View File

@ -679,6 +679,7 @@ void Daily::UpdateEventsTree(QTreeWidget *tree,Day *day)
for (int z=0;z<m.value().size();z++) { for (int z=0;z<m.value().size();z++) {
EventList & ev=*(m.value()[z]); EventList & ev=*(m.value()[z]);
int numDigits = ceil(log10(ev.count()+1));
for (quint32 o=0;o<ev.count();o++) { for (quint32 o=0;o<ev.count();o++) {
qint64 t=ev.time(o)+drift; qint64 t=ev.time(o)+drift;
@ -687,7 +688,7 @@ void Daily::UpdateEventsTree(QTreeWidget *tree,Day *day)
} }
QStringList a; QStringList a;
QDateTime d=QDateTime::fromMSecsSinceEpoch(t); // Localtime QDateTime d=QDateTime::fromMSecsSinceEpoch(t); // Localtime
QString s=QString("#%1: %2").arg((int)(++mccnt[code]),(int)3,(int)10,QChar('0')).arg(d.toString("HH:mm:ss")); QString s=QString("#%1: %2").arg((int)(++mccnt[code]),(int)numDigits,(int)10,QChar('0')).arg(d.toString("HH:mm:ss"));
if (m.value()[z]->raw(o) > 0) if (m.value()[z]->raw(o) > 0)
s += QString(" (%3)").arg(m.value()[z]->raw(o)); s += QString(" (%3)").arg(m.value()[z]->raw(o));