setValue change?

We are having an issue with SetValue in Deadline v6. Previously in v5 we were able to select multiple items using a list, but that no longer works. The single item selection still works fine though.

[code] # add row for task level folders, this works fine the list is propagated with the default values via SetItem
scriptDialog.AddRow()
scriptDialog.AddControl(‘TaskLabel’, ‘LabelControl’, ‘Tasks’, labelWidth, -1)
taskSelect = scriptDialog.AddComboControl(‘TaskMultiList’, ‘MultiSelectListControl’, None, GetTaskList(), (dialogWidth - labelWidth - 24), -1)
taskSelect.ValueModified.connect(GetLanguages)
scriptDialog.EndRow()

this is the function that’s used to change the selections, it’s being based on the selection in the box above the TaskLabel

def GetTasks(*args):
“”“Set the list of selected tasks.”""
global currTasks

allTasks = GetTaskList()

# get show, job, and card values
selShow = scriptDialog.GetValue('ShowCombo')
selJob = scriptDialog.GetValue('JobCombo')
selCards = scriptDialog.GetValue('CardMultiSelect')

# get a list of all task folder names
tasks = []
for card in selCards:
    shotObj = shot.Shot(selShow, selJob, card)
    taskList = shotObj['dir']
    
    tasks[-1:] = taskList
    
tasks.sort()
tasks = tuple(set(tasks))

# set selection of task list
scriptDialog.SetValue('TaskMultiList', tasks)  # no longer working, doesn't accept tuple or list, list item seems to work fine though such as tasks[0]

[/code]

The last line is where we are experiencing the problem.

I will have to get some of our coders to take a look and see if we can identify the issue. Hopefully it’s just a change in how that is coded in 6.x versus 5.x.

This is a bug in the MultiSelectListControl, so thanks for reporting this! It will be fixed in Deadline 6.2.

Note that the taskSelect object that is returned from scriptDialog.AddComboControl() is a standard QListWidget:
qt-project.org/doc/qt-4.8/qlistw … urrentItem

So you can do it the Qt way as a workaround for now. At the top of the script, import Qt.Core:

from PyQt4.QtCore import *

Then use this code like this to select the items:

    selection = ("two", "three", "six")
    for v in selection:
        items = taskSelect.findItems(v, Qt.MatchExactly)
        if items:
            for item in items:
                item.setSelected(True)

Cheers,
Ryan