Unsolved how do i perform center text in Qtablewidget
hi guys i wanna ask for help here,
how do i perform center tex in Qtablewidget?
just to make it clear, here is the preview of my table:
i want the text below the header is center, what should i do?
every answer it'll be appriciate it.
@farhanrbn See documentation: https://doc.qt.io/qt-5/qtablewidgetitem.html#setTextAlignment
Its a setting on the item.
QTableWidgetItem* item = new QTableWidgetItem( "text is here" );
item->setTextAlignment( Qt::AlignCenter );
but how do i make every item in my table align to center while all of my item is depends on my database?
@Redho-B-N In that case you should not use QTableWidget. You should use QTableView instead, with a data model,
@jsulm and hows to use that exactly, im sorry still news to this