[Qt-interest] QTableWidgetItem support for validators?
Stephen Kelly
steveire at gmail.com
Fri Sep 16 15:50:02 CEST 2011
Rui Maciel wrote:
> I intended to use a QTableWidget to edit the value of a set of numbers.
> Yet, I haven't found a way to force QTableWidget to only accept input
> which
> corresponds to a given number format. On the other hand, QLineEdit does
> provide this feature in the form of validator classes, such as
> QDoubleValidator.
>
> So, is it possible to force QTableWidget to only accept specific input,
> similar to what has been implemented in QLineEdit through validator
> classes?
>
>
> Thanks in advance,
> Rui Maciel
You should be able to use QItemEditorFactory to create lineedits with your
validator on them. You can set the factory on the delegate then.
All the best,
Steve.
More information about the Qt-interest-old
mailing list