Ejemplo n.º 1
0
def main():
    from sffairmaker.radio_group import RadioGroup
    from sffairmaker.color_slider import ColorSlider
    from os.path import join
    app = QApplication([])
    
    m = model.Model()
    m.sff().open(join(debugDataDir(), "kfm.sff"))
##        image = image_op.Image256(128, 1)
##        for x in xrange(128):
##            image.setPixel(x, 0, x)
##        colorTable = []
##        for i in xrange(256):
##            colorTable.append(qRgb(i, i, i))
##        image.setColorTable(colorTable)
    
##        spr = m.sff().newSpr(image=image)
    spr = m.sff().sprs()[0]
    table = SprColorTableEdit()
    table.setSpr(spr)
    
    slider = ColorSlider()
    slider.setValue(table.currentColor())
    slider.valueChanged.connect(table.setCurrentColor)
    table.currentColorChanged.connect(slider.setValue)
    
    ctable = CommonColorTableEdit()
    cslider = ColorSlider()
    cslider.setValue(ctable.currentColor())
    cslider.valueChanged.connect(ctable.setCurrentColor)
    ctable.currentColorChanged.connect(cslider.setValue)
    
    w = QWidget()
    w.setLayout(hBoxLayout(
        vBoxLayout(
            (table, 1),
            slider,
        ),
        vBoxLayout(
            (ctable, 1),
            cslider,
        ),
    ))
    w.show()
    
    app.exec_()
Ejemplo n.º 2
0
 def xmodel(self):
     return model.Model()