Is there any way to put an inputMask onto a QTreeWidgetItem that is listed as Qt::ItemIsEditable? I need to check to make sure that a value typed in is numeric. I know I can do this easily with a QLineEdit, but I don't know what kind of widget is created when you just create a default QTreeWidgetItem and set its text. I know that QTreeWidget has a method itemWidget() that returns a QWidget*, but I don't want to just cast it as a QLineEdit if it isn't one. I really want to be able to restrict what inputs the user can make.