4

Why QLCDNumber numbers can't be centered when the number of digits is lower than the number of digits allowed in the parameters of QLCDNumber ? Can I bypass this ?

Nejat
  • 31,784
  • 12
  • 106
  • 138

1 Answers1

2

As a workaround you can set the number of digits each time you set a new value :

ui->lcdNumber->display(value);
ui->lcdNumber->setDigitCount(QString("%1").arg(value).length());

Here QString("%1").arg(value).length() returns the number of digits in value. When you set it properly it would be aligned correctly.

Nejat
  • 31,784
  • 12
  • 106
  • 138