def window(self): button = QPushButton('Кнопка', self) button.clicked.connect(self.new_window) def new_window(self): widget = QWidget() widget.show()