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
def model_row_iter(model, start_index=QModelIndex()): | |
""" モデルのrowイテレータを返す | |
:type start_index: QModelIndex | |
:type model: QAbstractItemModel | |
""" | |
if start_index.isValid(): | |
yield start_index | |
while True: |
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/python | |
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals, print_function, absolute_import | |
""" | |
# 汎用検索オブジェクト | |
QAbstractItemViewに対して付加可能な検索オブジェクト。 | |
ツリー型モデルとテーブル型の両対応をしている。 | |
# 使い方 |
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/python | |
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals, print_function, absolute_import | |
import sys | |
from PySide.QtCore import * | |
from PySide.QtGui import * | |
from PySide.QtSvg import * | |
app = QApplication(sys.argv) |
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
echo deb http://se.archive.ubuntu.com/ubuntu trusty main universe | sudo tee /etc/apt/sources.list.d/temp-trusty.list | |
echo deb http://security.ubuntu.com/ubuntu trusty-security main universe | sudo tee -a /etc/apt/sources.list.d/temp-trusty.list | |
sudo apt update | |
sudo apt install libavcodec54 libavformat54 | |
sudo rm /etc/apt/sources.list.d/temp-trusty.list | |
sudo apt update |
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
# Minimal makefile for Sphinx documentation | |
# | |
# You can set these variables from the command line. | |
SPHINXOPTS = | |
SPHINXBUILD = sphinx-build | |
SPHINXPROJ = {{ project_fn }} | |
SOURCEDIR = {{ rsrcdir }} | |
BUILDDIR = {{ rbuilddir }} |
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
# coding: utf-8 | |
from PIL import Image, ImageOps, ImageChops, ImageFilter, ImageDraw, ImageDraw2 | |
import math | |
def create_mat(_rot, _pitch): | |
_pi = math.pi * (_rot / 180.) | |
_scale = 1.0 / _pitch | |
def _mul(x, y): | |
return ( |