Skip to content

Instantly share code, notes, and snippets.

@Bomberus
Created June 19, 2019 07:27
Show Gist options
  • Save Bomberus/368e181b6e5afae7eb315bf945f7ba3b to your computer and use it in GitHub Desktop.
Save Bomberus/368e181b6e5afae7eb315bf945f7ba3b to your computer and use it in GitHub Desktop.
asyncqt issue
import functools
from PyQt5.QtWidgets import QApplication, QPushButton, QWidget, QVBoxLayout
import sys
def slot(*args):
def outer(fn):
@functools.wraps(fn)
def wrapper(*args, **kwargs):
print("args", args)
print("kwargs", kwargs)
return wrapper
return outer
class Main():
@slot()
def hello(self, *args):
print(*args)
pass
main = Main()
main.hello()
app = QApplication(sys.argv)
widget = QWidget()
layout = QVBoxLayout()
widget.setLayout(layout)
button = QPushButton("hello")
layout.addWidget(button)
button.clicked.connect(main.hello)
widget.show()
app.exec_()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment