コード例 #1
0
class DemandStorageDialog(QDialog):
    def __init__(self):
        QDialog.__init__(self)
        self.ui = Ui_DemandStorageDialog()
        self.ui.setupUi(self)
        self.valid = QIntValidator(0, 1000000, self)
        self.ui.volume.setValidator(self.valid)
        
    def Load(self, v):
        self.ui.id.setText(v.id)
        self.ui.volume.setText(str(v.volume))
        self.ui.type.setText(str(v.type))
        self.ui.replcapacity.setText(str(v.replicationCapacity))
        
    def SetResult(self, v):
        v.id = self.ui.id.text()
        v.volume = int(self.ui.volume.text())
        v.type = int(self.ui.type.text())
        v.replicationCapacity = int(self.ui.replcapacity.text())

    def typeChanged(self):
        if self.ui.type.text()=="0":
            self.ui.replcapacity.setEnabled(False)
        else:
            self.ui.replcapacity.setEnabled(True)
コード例 #2
0
class DemandStorageDialog(QDialog):
    def __init__(self):
        QDialog.__init__(self)
        self.ui = Ui_DemandStorageDialog()
        self.ui.setupUi(self)
        self.valid = QIntValidator(0, 1000000, self)
        self.ui.volume.setValidator(self.valid)

    def Load(self, v):
        self.ui.id.setText(v.id)
        self.ui.volume.setText(str(v.volume))
        self.ui.type.setText(str(v.type))
        self.ui.replcapacity.setText(str(v.replicationCapacity))

    def SetResult(self, v):
        v.id = self.ui.id.text()
        v.volume = int(self.ui.volume.text())
        v.type = int(self.ui.type.text())
        v.replicationCapacity = int(self.ui.replcapacity.text())

    def typeChanged(self):
        if self.ui.type.text() == "0":
            self.ui.replcapacity.setEnabled(False)
        else:
            self.ui.replcapacity.setEnabled(True)
コード例 #3
0
 def __init__(self):
     QDialog.__init__(self)
     self.ui = Ui_DemandStorageDialog()
     self.ui.setupUi(self)
     self.valid = QIntValidator(0, 1000000, self)
     self.ui.volume.setValidator(self.valid)
コード例 #4
0
 def __init__(self):
     QDialog.__init__(self)
     self.ui = Ui_DemandStorageDialog()
     self.ui.setupUi(self)
     self.valid = QIntValidator(0, 1000000, self)
     self.ui.volume.setValidator(self.valid)