SHARE
TWEET

Untitled

a guest Oct 10th, 2019 212 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # -*- coding: utf-8 -*-
  2. """
  3. Created on Thu Sep 12 20:52:56 2019
  4.  
  5. @author: marcs
  6. """
  7. #import math
  8. import sys
  9. from PyQt5 import QtWidgets, uic
  10. from Bol import CBol
  11.  
  12.  
  13. Ui_MainWindow, QtBaseClass = uic.loadUiType("W2Practicum.ui")
  14.  
  15. class MyApp(QtWidgets.QMainWindow):
  16.     def __init__(self):
  17.         super(MyApp, self).__init__()
  18.         self.ui = Ui_MainWindow()
  19.         self.ui.setupUi(self)
  20.         self.ui.CijferInp.text()
  21.         self.bol = CBol()
  22.         self.ui.btnOmGrond.clicked.connect(self.klikOmG)
  23.         self.ui.btnOppGrond.clicked.connect(self.klikOppG)
  24.         self.ui.btnOppTot.clicked.connect(self.klikOppTot)
  25.         self.ui.btnInhTot.clicked.connect(self.klikInhTot)
  26.         self.ui.btnScale.clicked.connect(self.klikScale)
  27.        
  28.         #self._scene = QtWidgets.QGraphicsScene()
  29.         #self.ui.StraalInput.setScene(self._scene)
  30.        
  31.        
  32.     def klikOmG(self):
  33.         self.bol.circumference = float(self.ui.CijferInp.text())
  34.        
  35.         self.ui.lblInhTot.setText(str(float(self.bol.inhoud)))
  36.         self.ui.lblOmGrond.setText(str(float(self.bol.circumference)))
  37.         self.ui.lblOppGrond.setText(str(float(self.bol.area)))
  38.         self.ui.lblOppTot.setText(str(float(self.bol.totalArea)))
  39.        
  40.        
  41.     def klikOppG(self):
  42.        
  43.         self.bol.area = float(self.ui.CijferInp.text())
  44.        
  45.         self.ui.lblInhTot.setText(str(float(self.bol.inhoud)))
  46.         self.ui.lblOmGrond.setText(str(float(self.bol.circumference)))
  47.         self.ui.lblOppGrond.setText(str(float(self.bol.area)))
  48.         self.ui.lblOppTot.setText(str(float(self.bol.totalArea)))
  49.        
  50.        
  51.     def klikOppTot(self):
  52.        
  53.         self.bol.totalArea = float(self.ui.CijferInp.text())
  54.        
  55.         self.ui.lblInhTot.setText(str(float(self.bol.inhoud)))
  56.         self.ui.lblOmGrond.setText(str(float(self.bol.circumference)))
  57.         self.ui.lblOppGrond.setText(str(float(self.bol.area)))
  58.         self.ui.lblOppTot.setText(str(float(self.bol.totalArea)))
  59.        
  60.        
  61.        
  62.     def klikInhTot(self):
  63.        
  64.         self.bol.inhoud = float(self.ui.CijferInp.text())
  65.        
  66.         self.ui.lblInhTot.setText(str(float(self.bol.inhoud)))
  67.         self.ui.lblOmGrond.setText(str(float(self.bol.circumference)))
  68.         self.ui.lblOppGrond.setText(str(float(self.bol.area)))
  69.         self.ui.lblOppTot.setText(str(float(self.bol.totalArea)))
  70.        
  71.     def klikScale(self):
  72.         self.bol._scale = float(self.ui.ScaleInp.text())
  73.        
  74.         self.ui.lblInhTot.setText(str(float(self.bol.inhoud)))
  75.         self.ui.lblOmGrond.setText(str(float(self.bol.circumference)))
  76.         self.ui.lblOppGrond.setText(str(float(self.bol.area)))
  77.         self.ui.lblOppTot.setText(str(float(self.bol.totalArea)))
  78.        
  79. if __name__ == "__main__":
  80.     app = 0
  81.     app = QtWidgets.QApplication(sys.argv)
  82.     window = MyApp()
  83.     window.show()
  84.     sys.exit(app.exec_())
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top