Is there a way to set the max length of a QTableWidget item (table cell)? I have a table that is editable and I would like the max length to be 3 when a user is editing a cell.
Create a subclass of QStyledItemDelegate and grab the QLineEdit that is created for the cells. You can use QLineEdit::setMaxLength(int) to set the maximum length that you want.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more