本文整理匯總了Python中GUI.conectarClic方法的典型用法代碼示例。如果您正苦於以下問題:Python GUI.conectarClic方法的具體用法?Python GUI.conectarClic怎麽用?Python GUI.conectarClic使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GUI
的用法示例。
在下文中一共展示了GUI.conectarClic方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: main
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import conectarClic [as 別名]
#.........這裏部分代碼省略.........
ui.doubleSpin_IMC.setValue(imc)
gui.conectarValue(ui.doubleSpin_Peso, modificaIMC)
gui.conectarValue(ui.doubleSpin_Alt, modificaIMC)
#Determinar Grado de obesidad segun IMC
def dotarGrado():
if ui.doubleSpin_IMC.value() < 25:
ui.toolButton_Grado.setText("Ok")
ui.toolButton_Grado.setStyleSheet("color: #0dc434")
elif 25 <= ui.doubleSpin_IMC.value() <= 27.99:
ui.toolButton_Grado.setText("I")
ui.toolButton_Grado.setStyleSheet("color: #feff0d")
elif 28 <= ui.doubleSpin_IMC.value() <= 31.99:
ui.toolButton_Grado.setText("II")
ui.toolButton_Grado.setStyleSheet("color: #ee9711")
elif 32 <= ui.doubleSpin_IMC.value() <= 41.99:
ui.toolButton_Grado.setText("III")
ui.toolButton_Grado.setStyleSheet("color: #ff0000")
elif ui.doubleSpin_IMC.value() >= 42:
ui.toolButton_Grado.setText("IV")
ui.toolButton_Grado.setStyleSheet("color: #aa0821")
gui.conectarValue(ui.doubleSpin_IMC, dotarGrado)
gui.conectarValue(ui.doubleSpin_Peso, dotarGrado)
gui.conectarValue(ui.doubleSpin_Alt, dotarGrado)
#Declaraciones del toolButton Grado obesidad
WindowNivel = QtGui.QDialog()
uiNiv = Ui_DialogNivel()
uiNiv.setupUi(WindowNivel)
#Conexion de toolButton Grado obesidad y GUI Tabla Niveles
gui.conectarClic(ui.toolButton_Grado, WindowNivel.show)
gui.conectarAcp(uiNiv.pushButton, WindowNivel.accept)
#Calculo edad a partir de fecha
def calcularEdad(ui):
hoy = datetime.date.today()
fechaNac = datetime.date(ui.date_FNac.date().year(), ui.date_FNac.date().month(), ui.date_FNac.date().day())
cumple = fechaNac.replace(year = hoy.year)
anio = (hoy.year - fechaNac.year)
if anio > 0:
if hoy >= cumple:
ui.lineEdit_Edad.setText(str(anio))
elif hoy < cumple:
ui.lineEdit_Edad.setText(str(anio-1))
else:
ui.lineEdit_Edad.setText("0")
gui.conectar(ui.date_FNac, QtCore.SIGNAL("dateChanged(QDate)"), lambda: calcularEdad(ui))
gui.conectar(paciente.uiNP.date_FNac, QtCore.SIGNAL("dateChanged(QDate)"), lambda: calcularEdad(paciente.uiNP))
#Calculo metabolismo basal
def calcularMB():
if ui.combo_FM.currentIndex() == 0:
mb = 8.7 * ui.doubleSpin_POb.value() + 829
ui.doubleSpin_MB.setValue(mb)
elif ui.combo_FM.currentIndex() == 1:
mb = 11.6 * ui.doubleSpin_POb.value() + 879
ui.doubleSpin_MB.setValue(mb)
gui.conectarValue(ui.doubleSpin_POb, calcularMB)
gui.conectarIndex(ui.combo_FM, calcularMB)
#Incremento segun Actividad