Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Set Headers in Qlistwidget and Qtablewidget
tactical77 last edited by tactical77
I'm pretty new to qt and have to finish some stuff for school. I figured out how to add items to Qlistwidget and Qtablewidget but I need to have headers similar to the ones in the picture.
I also have already a cli program from my last homework which should be used to read in data from a text file and store it in objects and then in vectors. Can I just use it and
export the data into Qlistwidget?
Hi and welcome to devnet,
Do you mean the text ? If so, yes, you can use QTableWidget::setVerticalHeaderLabels.
Thanks it worked. I have another question. I know how to add strings in qlistwidget but I need to add a string and some doubles and integers all in the same row?
JonB last edited by
QListWidgetItems are "typically" used to display text, icon & checkbox. Are you sure you don't mean to use a
QTableWidgetfor "add a string and some doubles and integers all in the same row"?
I basically have some client data which is stored in objects and I have to create both a qlistwidget and a qtablewidget. Probably just in order to learn to use both of them. But each one has basically the same data output.
Thanks it works.