mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 23:49:35 -05:00
Merge pull request #2310 from defnax/avatardialog-fix-v2
Fixed Avatar storing on Avatar Dialog
This commit is contained in:
commit
8e0e4eb138
@ -151,8 +151,14 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>96</width>
|
||||
<height>96</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -171,7 +177,7 @@
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="images.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/images/edit_16.png</normaloff>:/images/edit_16.png</iconset>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
@ -264,7 +270,7 @@
|
||||
</action>
|
||||
<action name="actionSet_your_Avatar">
|
||||
<property name="icon">
|
||||
<iconset resource="images.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/images/add_image24.png</normaloff>:/images/add_image24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -62,6 +62,7 @@ private slots:
|
||||
|
||||
private:
|
||||
void updateInterface();
|
||||
QPixmap pixmap;
|
||||
|
||||
private:
|
||||
Ui::AvatarDialog *ui;
|
||||
|
Loading…
Reference in New Issue
Block a user