'pyqt5 problem. I am having trouble with classes. When I call the function it doesn't do anything at all
##imports
from PyQt5.QtWidgets import (QWidget, QPushButton, QLineEdit, QInputDialog, QApplication, QLabel,QMainWindow,)
from PyQt5.QtWidgets import QLineEdit
from PyQt5.QtGui import *
import sys
#defining class
class UI:
#basic window
def window(self,app,window,size,title,show,):
self.app = QApplication(sys.argv)
self.win = QMainWindow()
self.win.setGeometry(200,200,600,600)
self.win.setWindowTitle("Calculator App ")
self.win.show()
sys.exit(app.exec_())
#text that will show the functions of the calculator
def modes_header(self,type,text,pos,font):
self.functions_type = QLabel(win)
self.functions_text.setText("Modes")
self.functions_pos.move(10, 400)
self.functions_font.setFont(QFont('Constantinus',21))
#this will be the multiplication function
def multiply_button(self,label,text,pos,font):
self.multButton_type = QLabel(win)
self.multButton_text.setText("Multiply")
self.multButton_pos.move(10,450)
self.multButton_font("Arial",19)
#Calling Functions
ui = UI
win = ui.window
ui.window()
ui.modes_header()
ui.multiply_button()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
