本文整理汇总了Python中UI.widgets.Entrada_con_unidades.setDisabled方法的典型用法代码示例。如果您正苦于以下问题:Python Entrada_con_unidades.setDisabled方法的具体用法?Python Entrada_con_unidades.setDisabled怎么用?Python Entrada_con_unidades.setDisabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UI.widgets.Entrada_con_unidades
的用法示例。
在下文中一共展示了Entrada_con_unidades.setDisabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Isolinea
# 需要导入模块: from UI.widgets import Entrada_con_unidades [as 别名]
# 或者: from UI.widgets.Entrada_con_unidades import setDisabled [as 别名]
class Isolinea(QtWidgets.QDialog):
"""Widget for isoline configuration for mEoS plot tools"""
def __init__(self, unit, ConfSection, config, section="MEOS", parent=None):
"""Constructor
unit: subclass of unidad to define the isoline type
ConfSection: title of isoline
config: config of pychemqt project
"""
super(Isolinea, self).__init__(parent)
self.ConfSection = ConfSection
self.magnitud = unit.__name__
self.unidad = unit
self.section = section
layout = QtWidgets.QGridLayout(self)
layout.addWidget(QtWidgets.QLabel(
QtWidgets.QApplication.translate("pychemqt", "Start")), 1, 1)
self.inicio = Entrada_con_unidades(unit)
layout.addWidget(self.inicio, 1, 2, 1, 3)
layout.addWidget(QtWidgets.QLabel(
QtWidgets.QApplication.translate("pychemqt", "Fin")), 2, 1)
self.fin = Entrada_con_unidades(unit)
layout.addWidget(self.fin, 2, 2, 1, 3)
layout.addWidget(QtWidgets.QLabel(
QtWidgets.QApplication.translate("pychemqt", "Intervalo")), 3, 1)
if unit.__name__ == "Temperature":
self.intervalo = Entrada_con_unidades(unidades.DeltaT)
elif unit.__name__ == "Pressure":
self.intervalo = Entrada_con_unidades(unidades.DeltaP)
else:
self.intervalo = Entrada_con_unidades(unit)
layout.addWidget(self.intervalo, 3, 2, 1, 3)
self.Personalizar = QtWidgets.QCheckBox(
QtWidgets.QApplication.translate("pychemqt", "Customize"))
layout.addWidget(self.Personalizar, 4, 1, 1, 4)
self.Lista = QtWidgets.QLineEdit()
layout.addWidget(self.Lista, 5, 1, 1, 4)
self.Personalizar.toggled.connect(self.inicio.setDisabled)
self.Personalizar.toggled.connect(self.fin.setDisabled)
self.Personalizar.toggled.connect(self.intervalo.setDisabled)
self.Personalizar.toggled.connect(self.Lista.setEnabled)
layout.addItem(QtWidgets.QSpacerItem(
10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed),
6, 1, 1, 4)
if unit.__name__ != "float" and section != "Psychr":
self.Critica = QtWidgets.QCheckBox(
QtWidgets.QApplication.translate(
"pychemqt", "Include critic point line"))
layout.addWidget(self.Critica, 7, 1, 1, 4)
layout.addItem(QtWidgets.QSpacerItem(
10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed),
8, 1, 1, 4)
self.lineconfig = LineConfig(
ConfSection,
QtWidgets.QApplication.translate("pychemqt", "Line Style"))
layout.addWidget(self.lineconfig, 9, 1, 1, 4)
layout.addItem(QtWidgets.QSpacerItem(
10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed),
10, 1)
self.label = QtWidgets.QCheckBox(
QtWidgets.QApplication.translate("pychemqt", "Label"))
layout.addWidget(self.label, 11, 1)
self.variable = QtWidgets.QCheckBox(
QtWidgets.QApplication.translate("pychemqt", "Variable in Label"))
layout.addWidget(self.variable, 12, 1, 1, 4)
self.unit = QtWidgets.QCheckBox(
QtWidgets.QApplication.translate("pychemqt", "Units in Label"))
layout.addWidget(self.unit, 13, 1, 1, 4)
layout.addWidget(QtWidgets.QLabel(
QtWidgets.QApplication.translate("pychemqt", "Position")), 14, 1)
self.label5 = Entrada_con_unidades(int, value=0, width=25, frame=False,
readOnly=True)
self.label5.setFixedWidth(30)
layout.addWidget(self.label5, 14, 2)
self.Posicion = QtWidgets.QSlider(QtCore.Qt.Horizontal)
self.Posicion.valueChanged.connect(self.label5.setValue)
layout.addWidget(self.Posicion, 14, 3, 1, 2)
layout.addItem(QtWidgets.QSpacerItem(
10, 10, QtWidgets.QSizePolicy.Expanding,
QtWidgets.QSizePolicy.Expanding), 15, 4)
if config.has_section(section):
self.inicio.setValue(config.getfloat(section, ConfSection+'Start'))
self.fin.setValue(config.getfloat(section, ConfSection+'End'))
self.intervalo.setValue(
config.getfloat(section, ConfSection+'Step'))
self.Personalizar.setChecked(
config.getboolean(section, ConfSection+'Custom'))
if config.get(section, ConfSection+'List') != "":
T = []
for i in config.get(section, ConfSection+'List').split(','):
if unit.__name__ == "float":
T.append(representacion(float(i)))
else:
T.append(representacion(unit(float(i)).config()))
self.Lista.setText(",".join(T))
if unit.__name__ != "float" and section != "Psychr":
self.Critica.setChecked(
config.getboolean(section, ConfSection+'Critic'))
#.........这里部分代码省略.........