Hoping to emplace an (repetitive) icon for each vertical header (row).
Currently the header 'box' is empty; without any text - yet efforts to set via headerData() function in AbstractTableModel do not seem to work.
Below is the current non-functioning script(s):
def headerData(self,section,orientation,role):
if role != Qt.DisplayRole:
return
if orientation == Qt.Vertical and role == Qt.DecorationRole:
return QtGui.
QIcon(r
'C:\Program Files\QGIS Brighton\apps\qgis\python\plugins\GraphicGroundwater\buttons\zoomAndDrag.png')
if orientation == Qt.Horizontal:
return self.header[section]
def headerData(self,section,orientation,role):
if role != Qt.DisplayRole:
return
if orientation == Qt.Vertical and role == Qt.DecorationRole:
return QtGui.QIcon(r'C:\Program Files\QGIS Brighton\apps\qgis\python\plugins\GraphicGroundwater\buttons\zoomAndDrag.png')
if orientation == Qt.Horizontal:
return self.header[section]
To copy to clipboard, switch view to plain text mode
Thousand thanks for any clues.
Bookmarks