qpushbutton pyqt5

Solutions on MaxInterview for qpushbutton pyqt5 by the best coders in the world

showing results for - "qpushbutton pyqt5"
Thad
20 Jan 2017
1# needs to be imported first from from PyQt5.QtWidgets
2from PyQt5.QtWidgets import QPushButton
3btn = QPushButton("button1") # create it
4
5# now you can add it to your layout
6layout = QHBoxLayout() # from PyQt5.QtWidgets import QHBoxLayout
7layout.addWidget(btn)
8# or you can just add it to the window itself like:
9btn = QPushButton("button1", self)