PDA

View Full Version : QWidgetTable filtering text only numbers using QLineEdit and QDoubleValidator issue



tundo
23rd March 2013, 01:16
hi there,
i have a a QTableWidget that have to handle only double values and i don't know how to achieve it... i googled a lot and some confusing solutions found, i tried this one:
if understood well what im trying to do is like puttin QLineEdit into the QTableWIdgetItems selected by appropriate Slot (named myCellChanged); problem is when i finish to fill the table items it has an anormal behavior as sometimes it filter inputs and sometimes no.... what I'm doing wrong?


Here's my source:
http://pastebin.com/FXGS5Rpf


thanks

anwar.qt
26th March 2013, 12:35
What you want to do is use editors for items in QTableWidget. I would highly recommend you to use QItemEditorFactory. There are default editors available and also you can create and use your own.