I am using a QTableWidget
to input values for a user-defined tool's parameters. Each parameter has a maximum size limit in bytes.
I used QIntValidator
with QLineEdit
and setCellWidget
.
It's working fine up to 4 bytes signed integers, while not taking entry when set for 4 bytes unsigned integer.
QLineEdit *edit = new QLineEdit(ui->tableWidget);
edit->setValidator(new QIntValidator(tpMinValue.at(i).toUInt(), tpMaxValue.at(i).toUInt(), edit));
edit->setStyleSheet("QLineEdit { border: none }");
ui->tableWidget->setCellWidget((i-1), 2, edit);
Examples
tool A: max size is 2 bytes (65,535) unsigned integer; I am able to enter values up to 65,535 in the cell.
tool B: max size is 4 bytes (2,147,483,647) signed integer; I am able to enter values up to 2,147,483,647 in the cell.
tool C: max size is 4 bytes (4,294,967,295) unsigned integer; I am unable to enter any value in the cell.
It is not allowing me to enter any number in the cell, since the max allowed value of QIntValidator is (2,147,483,647) signed integer.
Is there an alternative way to overcome the issue?