GlyphDBEdit: show glyph texts for bold/italic glyphs as bold/italic.
This commit is contained in:
parent
13d0ade021
commit
76ca41dda1
1 changed files with 6 additions and 0 deletions
|
|
@ -26,6 +26,7 @@ from PyQt4.QtCore import (
|
||||||
from PyQt4.QtGui import (
|
from PyQt4.QtGui import (
|
||||||
QApplication,
|
QApplication,
|
||||||
QColor,
|
QColor,
|
||||||
|
QFont,
|
||||||
QTableView,
|
QTableView,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -58,6 +59,11 @@ class TextColumn(Column):
|
||||||
def data(self, glyph_data, role):
|
def data(self, glyph_data, role):
|
||||||
if role == Qt.DecorationRole:
|
if role == Qt.DecorationRole:
|
||||||
return glyph_data.image.qimage
|
return glyph_data.image.qimage
|
||||||
|
elif role == Qt.FontRole:
|
||||||
|
font = QFont()
|
||||||
|
font.setBold(glyph_data.bold)
|
||||||
|
font.setItalic(glyph_data.italic)
|
||||||
|
return font
|
||||||
else:
|
else:
|
||||||
return super().data(glyph_data, role)
|
return super().data(glyph_data, role)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue