pyqt5中带有无线电按钮的弹出消息框

问题描述

我有一个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_()

我将不胜感激

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)