Ejemplo n.º 1
0
def on_click():
    clearPaths()

    startAspect = dialog.listWidgetFrom.currentItem().text()
    endAspect = dialog.listWidgetTo.currentItem().text()
    length = dialog.spinBox.value()
    paths = Aspect.findPaths(aspectGraph, startAspect, endAspect, length)

    for path in paths:
        showAspectPath(path)
Ejemplo n.º 2
0
__author__ = 'Benni'

import sys

from PyQt4 import QtGui, QtCore

import Aspect
from Window import Ui_dialogAspector as Dlg


class Aspector(QtGui.QDialog, Dlg):
    def __init__(self):
        QtGui.QDialog.__init__(self)
        self.setupUi(self)

aspectGraph = Aspect.makeGraph()
app = QtGui.QApplication(sys.argv)
dialog = Aspector()
tintedPixmaps = {}

def tintPixmap(pixmap, color):
    newPixmap = QtGui.QPixmap(pixmap)
    painter = QtGui.QPainter(newPixmap)
    painter.setCompositionMode(painter.CompositionMode_SourceIn)
    painter.fillRect(newPixmap.rect(), color)
    painter.setCompositionMode(painter.CompositionMode_Multiply)
    painter.drawPixmap(0,0,pixmap)
    painter.end()
    return newPixmap

for aspect in Aspect.aspects: