Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
In PyQt5, it is enough to import the Qt module, and through it to get access to everything you need. If you immediately import all classes, you will simply litter your program.
For example:
from PyQt5 import Qt
class ExampleWidget(Qt.QWidget):
def __init__(self):
super().__init__()
layout = Qt.QVBoxLayout(self)
layout.addWidget(Qt.QLabel("Label"))
layout.addWidget(Qt.QLineEdit("LineEdit"))
layout.addWidget(Qt.QPushButton("PushButton"))
pb = Qt.QProgressBar()
pb.setValue(66)
layout.addWidget(pb)
if __name__ == '__main__':
app = Qt.QApplication([])
w = ExampleWidget()
w.show()
app.exec()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question