lecture des description dans un tooltip

This commit is contained in:
2026-03-05 10:09:58 +01:00
parent 5a03084daa
commit 8c55d902c0
2 changed files with 64 additions and 14 deletions
+13 -7
View File
@@ -285,16 +285,20 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
if self.comboBox.currentText() == 'toutes les catégories':
custom_list = schemaname_list
elif self.comboBox.currentText() == 'travaux':
custom_list = """(SELECT schemaname,tablename from pg_catalog.pg_tables
where schemaname like '""" + str(self.comboBox.currentText()) + """%' order by schemaname,tablename) UNION (SELECT schemaname,matviewname AS tablename FROM pg_catalog.pg_matviews where schemaname like '""" + str(self.comboBox.currentText()) + """%' order by schemaname,tablename) order by schemaname,tablename;"""
custom_list = schemaname_list[:-2] + """
WHERE schemaname LIKE '""" + str(self.comboBox.currentText()) + """%';
"""
else:
custom_list = """(SELECT schemaname,tablename from pg_catalog.pg_tables
where schemaname like '\\_""" + str(self.comboBox.currentText()) + """%' order by schemaname,tablename) UNION (SELECT schemaname,matviewname AS tablename FROM pg_catalog.pg_matviews where schemaname like '\\_""" + str(self.comboBox.currentText()) + """%' order by schemaname,tablename) order by schemaname,tablename;"""
custom_list = schemaname_list[:-2] + """
WHERE schemaname LIKE '_""" + str(self.comboBox.currentText()) + """%';
"""
else:
if self.comboBox.currentText() == 'toutes les catégories':
custom_list = schemaname_list_ref
else:
custom_list = """SELECT schemaname, tablename from pg_catalog.pg_tables WHERE schemaname LIKE '""" + str(self.comboBox.currentText()) + """' AND tablename NOT LIKE 'qgis_projects' order by schemaname, tablename;"""
custom_list = schemaname_list_ref[:-2] + """
WHERE schemaname LIKE '""" + str(self.comboBox.currentText()) + """%' AND tablename NOT LIKE 'qgis_projects';
"""
cur.execute(custom_list)
list_schema = cur.fetchall()
@@ -384,6 +388,7 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
self.tableWidget.setColumnCount(5)
i = 0
for value in list_schema:
metadata = value[2]
if dbtype == sigdb:
type_val = str(value[0])[1:3]
schema_name = str(value[0])[4:]
@@ -448,8 +453,9 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
self.tableWidget.setCellWidget(i, 4, self.FavButton)
# Coloration des lignes selon les droits d'accès
if (str(value[0]) + '.' + str(value[1])) in GrandUser:
pass # L'utilisateur a les droits
if (str(value[0]) + '.' + str(value[1])) in GrandUser: # L'utilisateur a les droits
for j in range(self.tableWidget.columnCount()):
self.tableWidget.item(i, j).setToolTip(metadata)
else:
# Coloration en violet si droits insuffisants
for j in range(self.tableWidget.columnCount()):