13 from PyQt5.QtWidgets import QDialog, QTreeWidgetItem, QDialogButtonBox, \ |
13 from PyQt5.QtWidgets import QDialog, QTreeWidgetItem, QDialogButtonBox, \ |
14 QHeaderView |
14 QHeaderView |
15 |
15 |
16 from E5Gui.E5Application import e5App |
16 from E5Gui.E5Application import e5App |
17 |
17 |
18 from Ui_MatchesDialog import Ui_MatchesDialog |
18 from .Ui_MatchesDialog import Ui_MatchesDialog |
19 |
19 |
20 |
20 |
21 class MatchesDialog(QDialog, Ui_MatchesDialog): |
21 class MatchesDialog(QDialog, Ui_MatchesDialog): |
22 """ |
22 """ |
23 Class implementing a dialog to show matching references/definitions. |
23 Class implementing a dialog to show matching references/definitions. |
27 def __init__(self, ui, showConfidence, parent=None, name=None): |
27 def __init__(self, ui, showConfidence, parent=None, name=None): |
28 """ |
28 """ |
29 Constructor |
29 Constructor |
30 |
30 |
31 @param ui reference to the UI object |
31 @param ui reference to the UI object |
|
32 @type UI.UserInterface |
32 @param showConfidence flag indicating the display of the |
33 @param showConfidence flag indicating the display of the |
33 confidence column (boolean) |
34 confidence column |
34 @param parent parent of this dialog (QWidget) |
35 @type bool |
35 @param name name of this dialog (string) |
36 @param parent parent of this dialog |
|
37 @type QWidget |
|
38 @param name name of this dialog |
|
39 @type str |
36 """ |
40 """ |
37 QDialog.__init__(self, parent) |
41 QDialog.__init__(self, parent) |
38 if name: |
42 if name: |
39 self.setObjectName(name) |
43 self.setObjectName(name) |
40 self.setupUi(self) |
44 self.setupUi(self) |
67 @pyqtSlot(QTreeWidgetItem, int) |
71 @pyqtSlot(QTreeWidgetItem, int) |
68 def on_matchesList_itemActivated(self, item, column): |
72 def on_matchesList_itemActivated(self, item, column): |
69 """ |
73 """ |
70 Private slot to handle the itemActivated signal of the list. |
74 Private slot to handle the itemActivated signal of the list. |
71 |
75 |
72 @param item reference to the activated item (QTreeWidgetItem) |
76 @param item reference to the activated item |
73 @param column column the item was activated in (integer) |
77 @type QTreeWidgetItem |
|
78 @param column column the item was activated in |
|
79 @type int |
74 """ |
80 """ |
75 lineno = int(item.text(1)) |
81 lineno = int(item.text(1)) |
76 fn = item.data(0, MatchesDialog.FilePathRole) |
82 fn = item.data(0, MatchesDialog.FilePathRole) |
77 e5App().getObject("ViewManager").openSourceFile(fn, lineno) |
83 e5App().getObject("ViewManager").openSourceFile(fn, lineno) |
78 |
84 |