Skip to content

Commit

Permalink
Added input field length calculation for 32 bit integer controls
Browse files Browse the repository at this point in the history
  • Loading branch information
fkesseler committed Jul 1, 2022
1 parent 83f1561 commit f225a38
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ IntegerEnumerationControl::IntegerEnumerationControl(int32_t id, int32_t min, in
m_MainLayout.addWidget(&m_LineEdit, 0, 2);
m_LineEdit.setAlignment(Qt::AlignRight);

//m_LineEdit.setMaxLength(10);
auto const len = int(std::ceil(std::log10(max+1)));
m_LineEdit.setMaxLength(len);

m_MainLayout.setColumnStretch(0, 2);
m_MainLayout.setColumnStretch(1, 2);
Expand Down

0 comments on commit f225a38

Please sign in to comment.