我的期望让索引到的数据居中显示,所以使用了setTextAlignment,但为什么会出现错误?
self.idInput.setText(self.bookListTable.item(rowIndex, 0).text()) # 设置id编号
self.idInput.setTextAlignment(QtCore.Qt.AlignCenter)

AttributeError: 'QLineEdit' object has no attribute 'setTextAlignment'. Did you mean: 'setAlignment'?