src/eric7/SqlBrowser/SqlConnectionWidget.py

branch
eric7
changeset 10069
435cc5875135
parent 9653
e67609152c5e
child 10431
64157aeb0312
equal deleted inserted replaced
10068:7febcdccb2a1 10069:435cc5875135
5 5
6 """ 6 """
7 Module implementing a widget showing the SQL connections. 7 Module implementing a widget showing the SQL connections.
8 """ 8 """
9 9
10 from PyQt6.QtCore import Qt, pyqtSignal 10 from PyQt6.QtCore import Qt, pyqtSignal, pyqtSlot
11 from PyQt6.QtGui import QAction 11 from PyQt6.QtGui import QAction
12 from PyQt6.QtSql import QSqlDatabase 12 from PyQt6.QtSql import QSqlDatabase
13 from PyQt6.QtWidgets import ( 13 from PyQt6.QtWidgets import (
14 QHeaderView, 14 QHeaderView,
15 QTreeWidget, 15 QTreeWidget,
106 if cItm is None or cItm.parent() is None: 106 if cItm is None or cItm.parent() is None:
107 return 107 return
108 self.__setActive(cItm.parent()) 108 self.__setActive(cItm.parent())
109 self.schemaRequested.emit(cItm.text(0)) 109 self.schemaRequested.emit(cItm.text(0))
110 110
111 @pyqtSlot(QTreeWidgetItem, int)
111 def __itemActivated(self, itm, column): 112 def __itemActivated(self, itm, column):
112 """ 113 """
113 Private slot handling the activation of an item. 114 Private slot handling the activation of an item.
114 115
115 @param itm reference to the item (QTreeWidgetItem) 116 @param itm reference to the item (QTreeWidgetItem)
125 else: 126 else:
126 self.__setActive(itm.parent()) 127 self.__setActive(itm.parent())
127 self.tableActivated.emit(itm.text(0)) 128 self.tableActivated.emit(itm.text(0))
128 self.__activating = False 129 self.__activating = False
129 130
131 @pyqtSlot(QTreeWidgetItem, QTreeWidgetItem)
130 def __currentItemChanged(self, current, previous): 132 def __currentItemChanged(self, current, previous):
131 """ 133 """
132 Private slot handling a change of the current item. 134 Private slot handling a change of the current item.
133 135
134 @param current reference to the new current item (QTreeWidgetItem) 136 @param current reference to the new current item (QTreeWidgetItem)

eric ide

mercurial