Hello,
I would like to specify the type (int, double, string) of each Item of my QTableWidget
I really want to use QTableWidgetItem to do it and no spinbox or lineEdit for performance issues.
Is there a way?
Hello,
I would like to specify the type (int, double, string) of each Item of my QTableWidget
I really want to use QTableWidgetItem to do it and no spinbox or lineEdit for performance issues.
Is there a way?
Setting user type in the constructor?
QTableWidgetItem::QTableWidgetItem ( int type = Type )
I don't understand this "type".
How does it work if I want to get a int or a string?
create some enum like this:
Qt Code:
enum MyItemType { INT = 1, STRING = 2, DOUBLE = 3 };To copy to clipboard, switch view to plain text mode
Then use your types to set it to the item in the constructor. With int QTableWidgetItem::type () const you can get what type you have set
The point of all this is to make the item editable with the good type (the user can't put "toto" for an int item)
I'm not sure I understand the thing you've just explained, but it doesn't seems to me that it will check what the user writte in the item no?
Bookmarks