Skip to content

Commit

Permalink
[ui] Fix broken img within HTML labels when referring to qrc images
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn authored and nyalldawson committed Apr 18, 2022
1 parent a3a0ebf commit 637e996
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/pyplugin_installer/installer.py
Expand Up @@ -166,7 +166,7 @@ def checkingDone(self):
tabIndex = 3 # PLUGMAN_TAB_UPGRADEABLE
# finally set the notify label
if status:
self.statusLabel.setText(u'<a href="%d"><img src="qrc:/images/themes/default/%s"></a>' % (tabIndex, icon))
self.statusLabel.setText(u'<a href="%d"><img src=":/images/themes/default/%s"></a>' % (tabIndex, icon))
self.statusLabel.setToolTip(status)
else:
iface.mainWindow().statusBar().removeWidget(self.statusLabel)
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsprojectlistitemdelegate.cpp
Expand Up @@ -78,7 +78,7 @@ void QgsProjectListItemDelegate::paint( QPainter *painter, const QStyleOptionVie

doc.setHtml( QStringLiteral( "<div style='font-size:%1px'><span style='font-size:%2px;font-weight:bold;'>%3%4</span><br>%5<br>%6</div>" ).arg( textSize ).arg( QString::number( titleSize ),
index.data( QgsProjectListItemDelegate::TitleRole ).toString(),
index.data( QgsProjectListItemDelegate::PinRole ).toBool() ? QStringLiteral( "<img src=\"qrc:/images/themes/default/pin.svg\">" ) : QString(),
index.data( QgsProjectListItemDelegate::PinRole ).toBool() ? QStringLiteral( "<img src=\":/images/themes/default/pin.svg\">" ) : QString(),
mShowPath ? index.data( QgsProjectListItemDelegate::NativePathRole ).toString() : QString(),
index.data( QgsProjectListItemDelegate::CrsRole ).toString() ) );
doc.setTextWidth( option.rect.width() - ( !icon.isNull() ? icon.width() + 4.375 * mRoundedRectSizePixels : 4.375 * mRoundedRectSizePixels ) );
Expand Down

0 comments on commit 637e996

Please sign in to comment.