Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What influences the visibility of QLCDNumber digits?

Tags:

qt

qt5

qlcdnumber

I do have the following code:

  Address = new QLCDNumber(this);
  Address->setDigitCount(4);
  Address->setSegmentStyle(QLCDNumber::Flat);
  Address->display(mValue);
  mainLayout->addWidget(Address);

  Value = new QLCDNumber(this);
  Value->setDigitCount(8);
  Value->setSegmentStyle(QLCDNumber::Flat);
  Value->display(mValue);
  mainLayout->addWidget(Value);

And the result is shown below. I see the only difference in the number of digits. If I change the number of digits for the first QLCDNumber to 6, it also gets thinner. How can I make the second, 8-digit number better visible?

enter image description here

like image 626
katang Avatar asked Aug 31 '25 02:08

katang


1 Answers

  Value = new QLCDNumber(this);
  Value->setMinimumWidth(Value->width()+1);

solves the problem, so I guess it is a kind of rounding error in the QLCDNumber size (or segment shape?) calculating algorithm.

like image 132
katang Avatar answered Sep 02 '25 21:09

katang