Instead of using QLineEdit for user input, use a QComboBox populated with valid choices. This prevents user from being able to create a pathgrid for a non-existent cell.