mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-06 11:15:07 +01:00
pyqt6 croaks if you pass a QPoint instead of a QPointF to QGradient classes
This commit is contained in:
parent
2cf2f2df8f
commit
8eab8118cc
1 changed files with 2 additions and 2 deletions
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
from qt.core import (
|
||||
QStyledItemDelegate, Qt, QTreeView, pyqtSignal, QSize, QIcon, QApplication, QStyle, QAbstractItemView,
|
||||
QMenu, QPoint, QToolTip, QCursor, QDrag, QRect, QModelIndex, QStyleOptionViewItem,
|
||||
QMenu, QPoint, QToolTip, QCursor, QDrag, QRect, QModelIndex, QPointF, QStyleOptionViewItem,
|
||||
QLinearGradient, QPalette, QColor, QPen, QBrush, QFont, QTimer
|
||||
)
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ def draw_text(self, style, painter, option, widget, index, item):
|
|||
lr.setRight(lr.right() * 2)
|
||||
br = painter.boundingRect(lr, flags, text)
|
||||
if br.width() > tr.width():
|
||||
g = QLinearGradient(tr.topLeft(), tr.topRight())
|
||||
g = QLinearGradient(QPointF(tr.topLeft()), QPointF(tr.topRight()))
|
||||
c = option.palette.color(QPalette.ColorRole.WindowText)
|
||||
g.setColorAt(0, c), g.setColorAt(0.8, c)
|
||||
c = QColor(c)
|
||||
|
|
|
|||
Loading…
Reference in a new issue