How do I add a header with data to a QTableWidget in Qt?

前端 未结 4 1135
轻奢々
轻奢々 2020-12-18 12:28

I\'m still learning Qt and I am indebted to the SO community for providing me with great, very timely answers to my Qt questions. Thank you.

I\'m quite confused on t

4条回答
  •  暖寄归人
    2020-12-18 13:24

    At the request of the person who steered me toward the right place, I am posting the way I accomplished this as an answer and I am accepting it.

        m_ui->teamTableWidget->setColumnCount(m_ui->teamTableWidget->columnCount()+1);
        QTableWidgetItem* qtwi = new QTableWidgetItem(QString("Last"),QTableWidgetItem::Type);
        m_ui->teamTableWidget->setHorizontalHeaderItem(0,qtwi);
    

提交回复
热议问题