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
GIMP Palette | |
Name: Agon Light Mode 0, 2 colors | |
Columns: 0 | |
# | |
0 0 0 Color 0 | |
255 255 255 Color 1 |
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 numpy as np | |
import math | |
WIDTH=32 | |
HEIGHT=24 | |
def frame2array(frame): | |
img = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) | |
img = cv2.resize(img, (WIDTH,HEIGHT)) |
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
# Parse Kicad schematic netlist into a LinuxCNC HAL configuration file | |
# | |
# Ed Nisley - KE4ZNU | |
# 2021-03 | |
import argparse | |
from pathlib import Path | |
from lxml import etree |
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 bash | |
# Get a random music file from modarchive.org and play it. | |
# Uses VLC. Many other players could work too. | |
# Check for needed programs. Exit if they are not found. | |
#if ! which xmp > /dev/null; then echo "xmp not installed. Try: apt install xmp"; exit 1; fi | |
if ! which vlc > /dev/null; then echo "VLC not installed. Try: apt install vlc"; exit 1; fi | |
if ! which curl > /dev/null; then echo "curl not installed. Try: apt install curl"; exit 1; fi | |
# Check if the user wants a specific module |
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 bash | |
# Plays a random MOD file from https://modarchive.org | |
# Depends on XMP (http://xmp.sourceforge.net/) | |
# https://gist.github.com/orhun/eda9701e357b625c2bada19563872715 | |
rand=$(shuf -i 1-189573 -n 1) | |
tmp=$(mktemp /tmp/${rand}.XXXXXXXX.mod) | |
curl https://modarchive.org/jsplayer.php?moduleid=${rand} > ${tmp} | |
xmp ${tmp} | |
rm ${tmp} |
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
# The file must be placed on /usr/lib/systemd/user/mycroft.service | |
# and need to be run as the user who owns the file permissions | |
# with the command systemctl --user start|enable mycroft.service | |
[Unit] | |
Description=Mycroft main service | |
After=network.target local-fs.target remote-fs.target | |
[Service] | |
Type=forking | |
RemainAfterExit=no |
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
# Applying a sort feature in a QTableView | |
import sys | |
from PyQt5.QtCore import (Qt, | |
QModelIndex, | |
QAbstractTableModel, | |
QSortFilterProxyModel) | |
from PyQt5.QtWidgets import (QApplication, | |
QTableView) |
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 | |
""" Short description of this Python module. | |
Longer description of this module. | |
This program is free software: you can redistribute it and/or modify it under | |
the terms of the GNU General Public License as published by the Free Software | |
Foundation, either version 3 of the License, or (at your option) any later | |
version. |
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 sys | |
import time | |
from PyQt5.QtGui import * | |
from PyQt5.QtWidgets import * | |
from PyQt5 import QtCore | |
from PyQt5.QtCore import Qt | |
var = 0 | |
f = "" | |
choiceStr = "" |
NewerOlder