From 5e90955e7d12125e5ffb18e5556036f70456b61c Mon Sep 17 00:00:00 2001 From: apprb Date: Fri, 26 Sep 2014 19:17:27 +0700 Subject: [PATCH] ChatForm: avatar scale --- widget/form/chatform.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/widget/form/chatform.cpp b/widget/form/chatform.cpp index 788596dd6..83f9a9892 100644 --- a/widget/form/chatform.cpp +++ b/widget/form/chatform.cpp @@ -475,7 +475,8 @@ void ChatForm::onAvatarChange(int FriendId, const QPixmap &pic) if (FriendId != f->friendId) return; - avatarLabel->setPixmap(pic); + QPixmap scaled = pic.scaled(40,40,Qt::KeepAspectRatio,Qt::SmoothTransformation); + avatarLabel->setPixmap(scaled); } void ChatForm::dragEnterEvent(QDragEnterEvent *ev)