修复通知hint处理图片时的bug
This commit is contained in:
parent
f150ebca0a
commit
37c02a90a1
|
@ -285,12 +285,11 @@ void PopupNotification::setHints(const QVariantMap &hints)
|
|||
auto it = hints.find(QStringLiteral("image-data"));
|
||||
if (it != end) {
|
||||
d->m_image = d->parseImageHint(it->value<QDBusArgument>());
|
||||
if (d->m_image.isNull()) {
|
||||
return;
|
||||
}
|
||||
const QSize max = d->maximumImageSize();
|
||||
if (d->m_image.size().width() > max.width() || d->m_image.size().height() > max.height()) {
|
||||
d->m_image = d->m_image.scaled(max, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
if (!d->m_image.isNull()) {
|
||||
const QSize max = d->maximumImageSize();
|
||||
if (d->m_image.size().width() > max.width() || d->m_image.size().height() > max.height()) {
|
||||
d->m_image = d->m_image.scaled(max, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (d->m_image.isNull()) {
|
||||
|
|
Loading…
Reference in New Issue