Fix a potential infinite loop when computing StructWidget layout
This commit is contained in:
parent
6524c125c3
commit
efdd2c708d
|
@ -52,7 +52,7 @@ void RichTextItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem &
|
|||
#else
|
||||
int postfixWidth = metric.width(elidedPostfix);
|
||||
#endif
|
||||
while(doc.size().width() > option.rect.width() - postfixWidth)
|
||||
while(!doc.isEmpty() && doc.size().width() > option.rect.width() - postfixWidth)
|
||||
{
|
||||
cursor.deletePreviousChar();
|
||||
doc.adjustSize();
|
||||
|
|
Loading…
Reference in New Issue