1 from builtins
import range
10 """ Holds a table to compare event contents. 14 logging.debug(self.__class__.__name__ +
": __init__()")
15 AbstractView.__init__(self)
16 QTableWidget.__init__(self, parent)
20 self.setSelectionMode(QTableWidget.SingleSelection)
25 QTableWidget.clear(self)
26 self.setColumnCount(1)
27 self.setHorizontalHeaderLabels([
'no file selected'])
28 self.horizontalHeaderItem(0).setTextAlignment(Qt.AlignLeft)
29 self.verticalHeader().hide()
31 self.setRowCount(self.
_rows)
34 """ Adds a row to the EventContentView. 40 self.setItem(self.
_rows - 1, i, item)
42 for entry, color
in items:
44 self.setItem(self.
_rows - 1, i, item)
51 """ Fill the EventContentView using the ContentsDict. 53 logging.debug(
'EventContentView: updateContent()')
56 self.setSortingEnabled(
False)
57 names = [
"Type",
"Label",
"Product",
"Process"]
65 self.setColumnCount(len(names))
66 self.setHorizontalHeaderLabels(names)
67 for i
in range(len(names)):
68 self.horizontalHeaderItem(i).setTextAlignment(Qt.AlignLeft)
69 self.setRowCount(len(allContent))
70 for entry
in allContent:
79 if "_".
join(entry)
in comment.keys():
80 text+=
" ("+comment[
"_".
join(entry)]+
")" 85 input=
"Input: " in name
86 output=
"Output: " in name
87 if column_before!=
None:
89 if this_column
and not column_before:
91 if not this_column
and column_before:
105 column_before=this_column
106 items += [(text, color)]
109 self.setSortingEnabled(
True)
113 """ Mark an item in the TableView as selected. 116 self.setCurrentItem(item)
119 """ Return an item in the TableView with a certain object. 122 for positionName, item
in self._itemDict.items():
124 items += [(positionName, item)]
126 return sorted(items)[0][1]
131 """ A QTableWidgetItem with a convenient constructor. 136 QTableWidgetItem.__init__(self, name)
137 self.setToolTip(tooltip)
138 self.setFlags(Qt.ItemIsEnabled)
139 self.setBackgroundColor(color)
def itemByObject(self, object)
def __init__(self, parent=None, name=None)
def _addRow(self, names, items)
def __init__(self, argument, color=Qt.white)
static std::string join(char **cmd)