PDA

View Full Version : How to use QTableWidgetItem::Usertype?



yannwilfried
7th October 2008, 15:24
Hi all,

i want to plot values from a QTableWidget in qwt. Can anyone let me know how i can restrict the item types in every cells of my table to double values?

In the Qt4 doc, i saw QTableWidgetItem::Usertype. Maybe it's the solution to my problem but i don't know how to use it.

Thx a lot 4 the answers.

jpn
12th October 2008, 14:52
Create a custom delegate and return QDoubleSpinBox as editor. See the Spin Box Delegate Example (http://doc.trolltech.com/4.4/itemviews-spinboxdelegate.html) for more details.

yannwilfried
23rd October 2008, 15:49
Thanks a lot. It works!