tkp
0
Q:

qpushbutton pyqt5

button = QPushButton('PyQt5 button', self)
button.setToolTip('This is an example button')
button.move(100,70)
0
# needs to be imported first from from PyQt5.QtWidgets
from PyQt5.QtWidgets import QPushButton
btn = QPushButton("button1") # create it

# now you can add it to your layout
layout = QHBoxLayout() # from PyQt5.QtWidgets import QHBoxLayout
layout.addWidget(btn)
# or you can just add it to the window itself like:
btn = QPushButton("button1", self)
0

New to Communities?

Join the community