From 5869f5d421f435dbc6c8e13f704867737853337c Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli Date: Sun, 23 Aug 2020 11:16:48 +0200 Subject: [PATCH] Visually show the different types --- relational_gui/guihandler.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/relational_gui/guihandler.py b/relational_gui/guihandler.py index da34184..ac4d7a0 100644 --- a/relational_gui/guihandler.py +++ b/relational_gui/guihandler.py @@ -249,7 +249,13 @@ class relForm(QtWidgets.QMainWindow): for i in rel.content: item = QtWidgets.QTreeWidgetItem() for j,k in enumerate(i): - item.setText(j, k) + if k is None: + item.setBackground(j, QtGui.QBrush(QtCore.Qt.darkRed, QtCore.Qt.Dense4Pattern)) + elif isinstance(k, (int, float)): + item.setForeground(j, QtGui.QPalette().link()) + elif not isinstance(k, str): + item.setForeground(j, QtGui.QPalette().brightText()) + item.setText(j, str(k)) self.ui.table.addTopLevelItem(item) # Sets columns