#!/usr/bin/env python

from itemslistwidget import ItemsListWidget

class ItemReqListWidget(ItemsListWidget):

    """
    classe utilizzata per la visualizzazione degli item_req
    """

    def changeSelection(self, row, column):
        selection = self.table.selectedRanges()
        for sel in selection:
            if (sel.bottomRow() == row and sel.columnCount() == 2):
                index = selection.index(sel)
                selection.pop(index)
                self.table.setRangeSelected(selection)
                break
            elif sel.bottomRow() == row and sel.columnCount() == 1 and\
                 sel.leftColumn() == column:
                self.table.selectRow(row)
                break

    def setRowSelected(self, id_item):
        row = self.table.rowCount() - 1
        for requirement in self.event.requirements:
            if requirement.tag_name == "item_req" and requirement.id == id_item:
                self.table.selectRow(row)

@@ -16,16 +16,70 @@
 python%0A%0A
+from PyQt4.QtGui import *%0Afrom PyQt4.QtCore import *%0A%0A
 from ite
@@ -247,120 +247,71 @@
 def 
-change
+setRow
 Select
-ion
+ed
 (self, 
-row, column):%0A        selection = self.table.selectedRanges()%0A        for sel in selecti
+id_item):%0A        if self.item is not N
 on
+e
 :%0A  
@@ -325,615 +325,117 @@
    i
-f (sel.bottomRow() == row and sel.columnCount() == 2):%0A                index = selection.index(sel)%0A                selection.pop(index)%0A                self.table.setRangeSelected(selection)%0A                break%0A            elif sel.bottomRow() == row and sel.columnCount() == 1 and%5C%0A                 sel.leftColumn() == column:%0A                self.table.selectRow(row)%0A                break%0A%0A    def setRowSelected(self, id_item):%0A        row = self.table.rowCount() - 1%0A        for requirement in self.event.requirements:%0A            if requirement.tag_name == %22item_req%22 and requirement.id == id_item:
+tem = self.table.findItems(id_item, Qt.MatchExactly)%0A            if item:%0A                row = item%5B0%5D.row()
 %0A   

remove changeSelection function and change setRowSelected function: search the item request in table and select its row