from PyQt4 import Qt
import sys
class Window:
def __init__(self):
self.app = Qt.QApplication(sys.argv)
self.window = Qt.QWidget()
self.window.setWindowTitle(u"-")
self.window.setGeometry(100,100,300,300)
self.layout = Qt.QVBoxLayout()
#self.layout.addStretch(1)
self.window.setLayout(self.layout)
slider = Qt.QSlider(Qt.Qt.Horizontal)
slider.setRange(0, 100)
self.layout.addWidget(slider)
delBut = Qt.QPushButton(u"удалить все кнопки")
self.layout.addWidget(delBut)
label = Qt.QLabel("1")
self.layout.addWidget(label)
Qt.QObject.connect(slider, Qt.SIGNAL("valueChanged(int)"), self.add_button)
Qt.QObject.connect(delBut, Qt.SIGNAL("clicked()"), self.del_buttons)
self.layoutB = Qt.QVBoxLayout()
self.layout.addLayout(self.layoutB)
self.window.show()
self.app.exec_()
def add_button(self,text):
button = Qt.QPushButton(str(text))
self.layoutB.addWidget(button)
def del_buttons(self):
while self.layoutB.count():
item = self.layoutB.itemAt(0)
self.layoutB.removeItem(item)
self.window.repaint()
Что вообще почитать что бы узнать какие функции есть у контролов и вообще по PyQt?