user3204810
user3204810

Reputation: 391

How to get QTableWidget columns label value

Is there a way to get QTableWidget's column label value? The inverse of setHorizontalHeaderLabels(QString) in Qt and the equivalent of GetColLabelValue (int col) wxWidgets: I'm looking for a long time in the Qt documentation but could not find the command I need

Upvotes: 1

Views: 7564

Answers (1)

KBi
KBi

Reputation: 383

Assuming your QTableWidget is named table, and you want from column index columnID:

QString str = table.horizontalHeaderItem(columnID)->text();

Upvotes: 7

Related Questions