Created
June 19, 2019 07:27
-
-
Save Bomberus/368e181b6e5afae7eb315bf945f7ba3b to your computer and use it in GitHub Desktop.
asyncqt issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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