Log management ok

This commit is contained in:
edo-neo 2024-12-02 14:23:33 +01:00
parent 099a07b08b
commit 62681cc80f
2 changed files with 13 additions and 6 deletions

View File

@ -44,14 +44,18 @@ class Logs_Management(Widget):
def adjust_column_widths(self):
"""Adjust the widths of columns to fit their content."""
# Assuming self.crud has an attribute 'table' that is a QTableWidget or QTableView
if hasattr(self.crud, 'table') and isinstance(self.crud.table, (QTableWidget,)):
self.crud.table.resizeColumnsToContents()
# Ensure that Crud has db_tw which is a QTableWidget
if hasattr(self.crud, 'db_tw') and isinstance(self.crud.db_tw, QTableWidget):
# Optionally, resize all columns to fit their contents initially
self.crud.db_tw.resizeColumnsToContents()
# Set a specific column width for columns; for example, set 'Info' column
for column in range(self.crud.db_tw.columnCount()):
self.crud.db_tw.setColumnWidth(column, 200) # Set width to 300 pixels
def row_filter(self, row, row_number, crud):
try:
if row["info_type"] != "Download":
return False, None, False
log_entry = log.generate(
id=row["id"],

View File

@ -1,7 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Logs_Management</class>
<class>Users_Management</class>
<widget class="QWidget" name="Users_Management">
<property name="windowModality">
<enum>Qt::WindowModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>