RefactoringRope/MatchesDialog.py

changeset 55
d501156be247
parent 43
39924831c795
child 62
1077db8d0589
equal deleted inserted replaced
54:e795cb8240aa 55:d501156be247
49 49
50 def __resort(self): 50 def __resort(self):
51 """ 51 """
52 Private method to resort the tree. 52 Private method to resort the tree.
53 """ 53 """
54 self.matchesList.sortItems(self.matchesList.sortColumn(), 54 self.matchesList.sortItems(
55 self.matchesList.sortColumn(),
55 self.matchesList.header().sortIndicatorOrder()) 56 self.matchesList.header().sortIndicatorOrder())
56 57
57 def __resizeColumns(self): 58 def __resizeColumns(self):
58 """ 59 """
59 Private method to resize the list columns. 60 Private method to resize the list columns.
63 64
64 @pyqtSlot(QTreeWidgetItem, int) 65 @pyqtSlot(QTreeWidgetItem, int)
65 def on_matchesList_itemActivated(self, item, column): 66 def on_matchesList_itemActivated(self, item, column):
66 """ 67 """
67 Private slot to handle the itemActivated signal of the list. 68 Private slot to handle the itemActivated signal of the list.
69
70 @param item reference to the activated item (QTreeWidgetItem)
71 @param column column the item was activated in (integer)
68 """ 72 """
69 lineno = int(item.text(1)) 73 lineno = int(item.text(1))
70 fn = item.data(0, MatchesDialog.FilePathRole) 74 fn = item.data(0, MatchesDialog.FilePathRole)
71 e5App().getObject("ViewManager").openSourceFile(fn, lineno) 75 e5App().getObject("ViewManager").openSourceFile(fn, lineno)
72 76
81 """ 85 """
82 if unsure: 86 if unsure:
83 conf = 50 87 conf = 50
84 else: 88 else:
85 conf = 100 89 conf = 100
86 itm = QTreeWidgetItem(self.matchesList, 90 itm = QTreeWidgetItem(
91 self.matchesList,
87 [self.__e5project.getRelativePath(resource.real_path), 92 [self.__e5project.getRelativePath(resource.real_path),
88 " {0:5d}".format(lineno), 93 " {0:5d}".format(lineno),
89 " {0:5d}%".format(conf)]) 94 " {0:5d}%".format(conf)])
90 itm.setData(0, MatchesDialog.FilePathRole, resource.real_path) 95 itm.setData(0, MatchesDialog.FilePathRole, resource.real_path)
91 itm.setTextAlignment(1, Qt.AlignRight) 96 itm.setTextAlignment(1, Qt.AlignRight)

eric ide

mercurial