mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-10-01 03:43:46 +08:00
PyQt demo app (#21625)
* build python helpers lib * call setMainWindow from python * put in helper lib * linter * move to scripts old-commit-hash: 25e4e94691d90f1a4496a2742c63ede108593e15
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
|
||||
import os
|
||||
from cffi import FFI
|
||||
|
||||
import sip # pylint: disable=import-error
|
||||
|
||||
from common.ffi_wrapper import suffix
|
||||
from common.basedir import BASEDIR
|
||||
|
||||
|
||||
def get_ffi():
|
||||
lib = os.path.join(BASEDIR, "selfdrive", "ui", "qt", "libpython_helpers" + suffix())
|
||||
|
||||
ffi = FFI()
|
||||
ffi.cdef("void set_main_window(void *w);")
|
||||
return ffi, ffi.dlopen(lib)
|
||||
|
||||
|
||||
def set_main_window(widget):
|
||||
ffi, lib = get_ffi()
|
||||
lib.set_main_window(ffi.cast('void*', sip.unwrapinstance(widget)))
|
||||
Reference in New Issue
Block a user