mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-14 16:18:48 -05:00
Fixed Avatar storing on Avatar Dialog
This commit is contained in:
parent
30892c9b27
commit
1d5396d509
3 changed files with 13 additions and 6 deletions
|
|
@ -132,7 +132,7 @@ void AvatarDialog::getAvatar(QPixmap &avatar)
|
|||
|
||||
void AvatarDialog::getAvatar(QByteArray &avatar)
|
||||
{
|
||||
const QPixmap *pixmap = ui->avatarLabel->pixmap();
|
||||
pixmap = ui->avatarLabel->extractCroppedScaledPicture();
|
||||
if (!pixmap) {
|
||||
avatar.clear();
|
||||
return;
|
||||
|
|
@ -141,7 +141,7 @@ void AvatarDialog::getAvatar(QByteArray &avatar)
|
|||
QBuffer buffer(&avatar);
|
||||
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
pixmap->save(&buffer, "PNG"); // writes image into ba in PNG format
|
||||
pixmap.save(&buffer, "PNG"); // writes image into ba in PNG format
|
||||
}
|
||||
|
||||
void AvatarDialog::load()
|
||||
|
|
@ -331,6 +331,6 @@ void AvatarDialog::addAvatar()
|
|||
QString sticker = qobject_cast<QPushButton*>(sender())->statusTip();
|
||||
QPixmap pixmap(sticker);
|
||||
|
||||
ui->avatarLabel->setPixmap(pixmap);
|
||||
ui->avatarLabel->setPicture(pixmap);
|
||||
updateInterface();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue