nskd | 2021-04-13 06:52:05 UTC | #1
Hi,
I am starting out on learning pyQT5 and building an app that require the use of QTableview. I need help to understand how I can suppress the text or Boolean values, and just display the icons in the cell of QTableView.
I will be grateful if someone can show me a working model of how it works. With a working model, I believe I can understand the code and how things works. Thanks.
Salem_Bream | 2021-04-18 02:49:34 UTC | #2
you need to change the DisplayTole data returned from the model..
PyQt/PySide 1:1 Coaching with Martin Fitzpatrick — Save yourself time and frustration. Get one on one help with your Python GUI projects. Working together with you I'll identify issues and suggest fixes, from bugs and usability to architecture and maintainability.
add these 2 lines to data function:
Packaging Python Applications with PyInstaller by Martin Fitzpatrick — This step-by-step guide walks you through packaging your own Python applications from simple examples to complete installers and signed executables.
if role==Qt.DisplayRole and isinstance(self._data[index.row(), index.column()], bool):
return None