class ButtonMap (QtGui.QPushButton): name = "" def __init__ (self, name, parent=None): self.name = name super(ButtonMap, self).__init__(s, parent) self.clicked.connect(self.buttonclick) but_click = QtCore.Signal(str) def buttonclick(self): self.but_click.emit(self.name)
for num in range (0, len(results)): Button = ButtonMap(button_text) Button.but_click.connect(self.onActivated) self.button_list.append(Button) self.layout.addWidget(self.button_list[num])
def onActivated(self): method_name = self.sender().text()
Pythonclass Window(QtGui.QMainWindow): def resizeEvent(self, event): # Тут что-то делаем при изменении размеров окна
QObject: Cannot create children for a parent that is in a different thread.(Parent is Oxygen::ScrollBarEngine(0x2444c70), parent's thread is QThread(0x157bc50), current thread is MyThread(0x31b7a80)QObject::setParent: Cannot set parent, new parent is in a different threadQObject::setParent: Cannot set parent, new parent is in a different threadОшибка сегментирования
QtCore.QCoreApplication.flush() self.ClientObj.app.flush()