Reputation: 575
I'm creating a sort of little spreadshirt and I need to insert only numbers in all the cells of a column.
Is there anyway to do this just with the tablewidget or do I need to "fill" table with LineEdit and then restict on some way the LineEdit input?
Can someone point me to the right direction?
Upvotes: 0
Views: 2296
Reputation: 1553
After perusing some of the documentation, it looks like you might have to use QLineEdit
widgets and setValidator
to a QDoubleValidator
. This is a fairly simple way to accomplish what you want, but for more complex spreadsheets you might need to get into something like a QTableView
and get down and dirty in Qt's Model/View framework.
Upvotes: 1