Esempio n. 1
0
def editors():
    d_e = DictEditorWidget()
    d_e.setMinimumSize(400, 100)
    d = OrderedDict()

    d['taco'] = 15
    d['quesadilla'] = 20

    d_e.setDict(d)

    d_e.dictEdited.connect(dictEmitted)

    initial = (d_e, d)

    # recreate dictEditor
    d_e = DictEditorWidget()
    d_e.setMinimumSize(400, 100)
    d = OrderedDict()

    d['taco'] = 15
    d['quesadilla'] = 20

    d_e.setDict(d)

    d_e.dictEdited.connect(dictEmitted)

    new_d = OrderedDict()
    new_d['potato'] = 1
    new_d['carrot'] = 2
    d_e.setDict(new_d)
    reinitial = (d_e, new_d)
    print "Finished initialize for both"
    return (initial, reinitial)
Esempio n. 2
0
def editors():
    d_e = DictEditorWidget()
    d_e.setMinimumSize(400, 100)
    d = OrderedDict()

    keyList = ['potato', 'carrot', 'marshmallow', 'taco', 'quesadilla']

    d_e.setValidKeys(keyList)

    d['taco'] = 15
    d['quesadilla'] = 20

    d_e.setDict(d)

    d_e.dictEdited.connect(dictEmitted)

    initial = (d_e, d, keyList)

    # recreate dictEditor
    d_e = DictEditorWidget()
    d_e.setMinimumSize(400, 100)
    d = OrderedDict()

    # commenting this line breaks insert
    keyList = ['potato', 'carrot', 'marshmallow', 'taco', 'quesadilla']

    d_e.setValidKeys(keyList)

    d['taco'] = 15
    d['quesadilla'] = 20

    d_e.setDict(d)

    d_e.dictEdited.connect(dictEmitted)

    new_d = OrderedDict()
    new_d['potato'] = 1
    new_d['carrot'] = 2
    d_e.setDict(new_d)
    reinitial = (d_e, d, keyList)
    return (initial, reinitial)