QTableWidget - putting multiple lines of text in one row

前端 未结 3 1704
天命终不由人
天命终不由人 2021-02-06 11:10

Is it possible to put multiple lines of text in one row of QTableWidget?

3条回答
  •  不思量自难忘°
    2021-02-06 11:52

    You can also simply use \n to start new line in a cell :-)

    For example:

        ui->tableWidget->insertRow(i);
    
        QTableWidgetItem *newItem = new QTableWidgetItem("Line 1 \n Line 2");
        ui->tableWidget->setItem(0,0,newItem);
    

提交回复
热议问题