Skip to content

Instantly share code, notes, and snippets.

from functools import partial
from timeit import timeit
from PySide6.QtCore import QCoreApplication, QObject, Slot
from qtgql import slot
def manual():
class ManualTyping(QObject):
@Slot(str, int, result="int")
@nrbnlulu
nrbnlulu / pyside_gql_subscriber.py
Last active November 24, 2022 07:22
graphql-transport-ws implementation with `QWebSocket`
import uuid
from dataclasses import dataclass, asdict, field, is_dataclass
import json
from qtpy import QtCore as qtc, QtWebSockets as qtws, QtNetwork as qtn
from typing import NamedTuple, Optional, NewType, Union, Any
from tzvui.network.client import HOST, PORT
from tzvui.qthacks import slot
@nrbnlulu
nrbnlulu / generic_qml_model_generator.py
Last active August 3, 2022 14:01
Qt Qml Generic Model
import typing
import attrs
from attrs import define, NOTHING, asdict
from typing import TypeVar, Any
from src.tools.utils import to_camel_case
from qtpy import QtCore as qtc
from src.tools.exceptions import ModelError
T = TypeVar("GenericType")
RoleDefined = TypeVar("RokeDefined")