我有一个python函数,将弹出消息显示为qmessagebox,其中包括一组单选按钮,其中单选按钮是从列表中初始化的。
该列表是根据数据框的dtypes创建的,并返回列名称。
问题是,当消息弹出时,它不包含任何单选按钮。
我的代码中的错误在哪里?
def showColumnINTType(self,df):
msg = QtWidgets.QMessageBox()
msg.setWindowTitle("Numeric Columns")
msg.setText("Select the column to add to pie chart values")
msg.setIcon(QtWidgets.QMessageBox.Question)
msg.setStandardButtons(QMessageBox.Cancel | QMessageBox.Retry | QMessageBox.Ignore)
self.my_vertical_layout = QHBoxLayout()
column_int_types=([key for key in dict(df.dtypes) if dict(df.dtypes)[key] in ['float64','int64']])
for cit in column_int_types:
q_int_type = QtWidgets.QRadioButton(cit,self)
self.my_vertical_layout.addWidget(q_int_type)
x = msg.exec_()
我将不胜感激