从一个 class 到另一个 QSpinBox 获取价值

Getting value from a QSpinBox from one class to another

我用 qt 设计器设计了一个 ui,我在 class 中有一个 QSpinBox,我需要从另一个 class 中获取它的值,但相反,我得到了这个 <function class.fun at 0x0000028549B1DEE0> 当我打印它时。 当我尝试在同一个 class 中打印时它起作用了,请帮助

代码:

class Ui_Form(object):
    row = 1

    def setupUi(self, Form):
        
    --> self.repeat_2 = QtWidgets.QSpinBox(Form)
        self.repeat_2.setGeometry(QtCore.QRect(390, 310, 121, 51))
        self.repeat_2.setFont(font)
        self.repeat_2.setMinimum(1)
        self.repeat_2.setMaximum(1000000000)
        self.repeat_2.setObjectName("repeat_2")
        
        QtCore.QMetaObject.connectSlotsByName(Form)

    def retranslateUi(self, Form):
        _translate = QtCore.QCoreApplication.translate
        Form.setWindowTitle(_translate("Form", "E-aalim Google Maps"))
        self.strt_btn.setText(_translate("Form", "Start"))
        self.label_2.setText(_translate("Form", "Copyrights ©LorD OmaR®"))
        self.label_3.setText(_translate("Form", "Version 1.1"))
        self.email_choice.setCurrentText(
            _translate("Form", "blogs-vento@eaalim-blogs-commenter.iam.gserviceaccount.com"))
        self.email_choice.setItemText(0,
                                      _translate("Form", "blogs-vento@eaalim-blogs-commenter.iam.gserviceaccount.com"))
        self.email_choice.setItemText(1, _translate("Form",
                                                    "eaalim-comentarista@eaalim-blogs-commenter.iam.gserviceaccount.com"))
        self.warn.setText(_translate("Form", "-Make Sure To Share This Email With The Sheet-"))
        self.title.setText(_translate("Form", "E-aalim Google Maps"))
        self.repeat.setText(_translate("Form", "Repeat:"))
        self.strt_row.setText(_translate("Form", "Start Row:"))

    def asd(self):
        print(self.repeat_2.value())


class class2:
    Ui_Form.asd

尝试:

class class2(QtWidgets.QWidget):
    def __init__(self):
        super().__init__()

        self.ui = Ui_Form()
        self.ui.setupUi(self)
        self.uiForm.asd()