how do i perform center text in Qtablewidget
Unsolved
General and Desktop
-
-
@farhanrbn See documentation: https://doc.qt.io/qt-5/qtablewidgetitem.html#setTextAlignment
-
Hi
Its a setting on the item.
QTableWidgetItem* item = new QTableWidgetItem( "text is here" );
item->setTextAlignment( Qt::AlignCenter );
ui->tableWidget->setItem(1,0,item); -
@Redho-B-N In that case you should not use QTableWidget. You should use QTableView instead, with a data model,