Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[Solved] Setting the alignment in a QTableWidget



  • QLabel has setAlignment(), but I can't find anything like that for QTableWidget. All I'd like to do is have horizontal centering for all data in cells.



  • Just call "setTextAlignment() ":/doc/qt-4.8/qtablewidgetitem.html#setTextAlignment on the [[Doc:QTableWidgetItem]]s.


Log in to reply