Answer the question
In order to leave comments, you need to log in
Why wasn't the graphical interface drawn in the terminal after launch?
Converted ui file to python code.
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtGui import QIcon
from my_dezainer import Ui_MainWindow
class CurrencyConv(QtWidgets.QMainWindow):
def __init__(self):
super(CurrencyConv, self).__init__()
self.ui = Ui_MainWindow( )
self.ui.setupUi(self)
app = QtWidgets.QApplication([])
application = CurrencyConv()
application.show()
sys.exit(app.exec())
But it loads empty window without design, in Visual st code editor Code
Although the file itself is converted to py format, it opens with a design through the console!
where is the error please help?
Answer the question
In order to leave comments, you need to log in
Try like this
class CurrencyConv(QtWidgets.QMainWindow, Ui_MainWindow):
def __init__(self):
super().__init__()
QtWidgets.QMainWindow.__init__(self)
self.setupUi(self)
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
application = CurrencyConv()
application.show()
sys.exit(app.exec_())
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question