Creating QTableWidget Header with multilinetext
Solved
General and Desktop
-
Hello
I was trying to create multiline text in Header of QTableWidget. Nothing worked for me. The Cells can be created with multiline text but header am not sure if there is a simple way. Could anyone help me with thisThanks !!
-
@doshirushabh Already tried this yet?
ui->tableWidget->setColumnCount(1);
ui->tableWidget->setHorizontalHeaderItem(0, new QTableWidgetItem("Something")); -
Hi and welcome.
You can use\n
to make header with multi-line text. -
@doshirushabh
I did this waytable->setColumnCount(1); table->setHorizontalHeaderLabels(QString("HEADER 1 \n Header_nextline").split(";"));
-
@doshirushabh
Once your problem is solved please use the Topic Tools button to mark as Solved.
Thank you!