As far as I can tell, the reason Qt5 Designer does not load custom PyQt5 widgets
is due to the 'stock' shared library libpyqt5.so
(which comes with PyQt5) not
being built for the correct combination of the Python and Qt versions. It seems
the only way to get around this is to build PyQt5 from source so we will have a
libpyqt5.so
that is correct and will be able to load the custom widgets.
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
#!/usr/bin/python2.7 | |
"""Quick hack of 'modern' OpenGL example using pysdl2 and pyopengl | |
Based on | |
pysdl2 OpenGL example | |
http://www.arcsynthesis.org/gltut/Basics/Tut02%20Vertex%20Attributes.html | |
http://schi.iteye.com/blog/1969710 | |
""" | |
import sys |
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
cmake_minimum_required(VERSION 2.8.11) | |
project(VtkFboInQtQuick) | |
set(CMAKE_INCLUDE_CURRENT_DIR ON) | |
set(CMAKE_AUTOMOC ON) | |
find_package(VTK REQUIRED) | |
include(${VTK_USE_FILE}) |
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
cmake_minimum_required(VERSION 2.8) | |
project(OCVSamples) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | |
find_package(OpenCV 3.0 QUIET) | |
if(OpenCV_FOUND) | |
add_definitions(-DUSE_OPENCV3) | |
else() | |
message(FATAL_ERROR "OpenCV > 3.0 not found.") |
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 cv2 | |
import sys | |
class Camera(object): | |
def __init__(self, index=0): | |
self.cap = cv2.VideoCapture(index) | |
self.openni = index in (cv2.CAP_OPENNI, cv2.CAP_OPENNI2) | |
self.fps = 0 |
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
#! /usr/bin/env python | |
import sys | |
from websocket import create_connection | |
uri = 'ws://' + sys.argv[1] + ':8181/core' | |
ws = create_connection(uri) | |
print "Sending " + sys.argv[2] + " to " + uri + "..." | |
if len(sys.argv) >= 4: | |
data = sys.argv[3] | |
else: |
cd /usr/src
curl -L --insecure https://www.rtai.org/userfiles/downloads/RTAI/rtai-5.0-test2.tar.bz2 | tar xj
curl -L https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.18.20.tar.xz | tar xJ
curl -L http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18.20-vivid/linux-image-3.18.20-031820-generic_3.18.20-031820.201508081633_amd64.deb -o linux-image-3.18.20-generic-amd64.deb
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 threading | |
from gi.repository import GObject | |
# calls f on another thread | |
def async_call(f, on_done): | |
""" | |
Starts a new thread that calls f and schedules on_done to be run (on the main | |
thread) when GTK is not busy. | |
Args: |
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
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
#https://developer.gnome.org/pygobject/2.28/ | |
#http://www.pygtk.org/articles/subclassing-gobject/sub-classing-gobject-in-python.htm#d0e570 | |
from gi.repository import GObject | |
from gi.repository import GLib | |
class GAsyncSpawn(GObject.GObject): |
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
# Stream a video | |
ffmpeg -re -i video.avi -vf "scale=40:ih*40/iw, crop=40:16" -f rawvideo -vcodec rawvideo -sws_flags bilinear -pix_fmt rgb24 - > /dev/udp/matelight.cbrp3.c-base.org/1337 | |
# Loop a gif | |
ffmpeg -re -ignore_loop 0 -i image.gif -vf "scale=40:ih*40/iw, crop=40:16" -f rawvideo -vcodec rawvideo -sws_flags bilinear -pix_fmt rgb24 - > /dev/udp/matelight.cbrp3.c-base.org/1337 | |
# Stream webcam | |
# Mac | |
ffmpeg -re -f avfoundation -r 30 -s 1280x720 -i "0" -vf "scale=40:ih*40/iw, crop=40:16, pp=autolevels:f, eq=1.5" -f rawvideo -vcodec rawvideo -sws_flags bilinear -pix_fmt rgb24 - > /dev/udp/matelight.cbrp3.c-base.org/1337 |
NewerOlder