Noob
24th May 2013, 17:16
So I have to start from begining,
I need to have a class of item that contains a few information about the object. But on the table, I only want to display the name of an item. The whole rest of informtion I want to display in other place, not the table.
So I want to make a subclass inheriting from QTableWidgetItem in which I want to place the extanded information about the item (a bounch o QStrings and some qints, bools).
I am not sure how to write this class. What methods do I need to overload? I see there is a data() method, and this method returns the value for the given role. And here I stucked a bit, What are that role in fact?? If could you describe me how does it works, I will be thankfull.
Thanks for any hint!
I need to have a class of item that contains a few information about the object. But on the table, I only want to display the name of an item. The whole rest of informtion I want to display in other place, not the table.
So I want to make a subclass inheriting from QTableWidgetItem in which I want to place the extanded information about the item (a bounch o QStrings and some qints, bools).
I am not sure how to write this class. What methods do I need to overload? I see there is a data() method, and this method returns the value for the given role. And here I stucked a bit, What are that role in fact?? If could you describe me how does it works, I will be thankfull.
Thanks for any hint!