Skip to content

Instantly share code, notes, and snippets.

@jazzycamel
jazzycamel / threads1.py
Last active March 29, 2023 21:49
Simple example of the correct way to use (Py)Qt(5) and QThread
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from itertools import count, islice
class Threaded(QObject):
result=pyqtSignal(int)
def __init__(self, parent=None, **kwargs):
super().__init__(parent, **kwargs)
@jazzycamel
jazzycamel / thread2.py
Created February 11, 2016 11:09
Simple example of threaded loop
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from itertools import count, islice
from time import sleep
class Threaded(QObject):
count=pyqtSignal(int)
def __init__(self, parent=None, **kwargs):
super().__init__(parent, **kwargs)
@jazzycamel
jazzycamel / QtProjectWithFaceID.pro
Last active August 14, 2020 14:32
Using iOS Face ID (and Touch ID) with Qt5
...
ios {
OBJECTIVE_HEADERS += localAuth.h
OBJECTIVE_SOURCES += localAuth.mm
HEADERS += localAuth-c-interface.h
LIBS += -framework LocalAuthentication
}
@jazzycamel
jazzycamel / buttons.ino
Created January 1, 2017 13:22
Arduino PS/2 Mouse Buttons
#include "ps2.h"
PS2 mouse(6,5);
void setup(){
mouse.mouse_init();
}
void loop(){
char stat,x,y;